Advertisement
osmarks

libuttp

Sep 24th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. local by_value_metatable = {
  2. __index = function(t, k)
  3. for _, v in pairs(t) do
  4. if k == v then return v end
  5. end
  6. end
  7. }
  8.  
  9. local uttp = {}
  10.  
  11. uttp.statuses = {
  12. OK = 0,
  13. BAD_REQUEST = 100,
  14. NOT_FOUND = 101,
  15. VERSION_MISMATCH = 300
  16. }
  17.  
  18. setmetatable(uttp.statuses, by_value_metatable)
  19.  
  20. return uttp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement