diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-17 19:55:36 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-17 19:55:36 +0200 |
| commit | 380195f7cd5e57acf2c1cf2bc41069e6b0b979ed (patch) | |
| tree | 32a88fb22a7fbe8f1fd5c105156d1f928c93950d /src/commands.h | |
| download | bokf-0.1.0.tar.gz bokf-0.1.0.zip | |
Initial commit: daemon, clients, docs, Docker deploy pipelinev0.1.0
Diffstat (limited to 'src/commands.h')
| -rw-r--r-- | src/commands.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/commands.h b/src/commands.h new file mode 100644 index 0000000..d04affc --- /dev/null +++ b/src/commands.h @@ -0,0 +1,33 @@ +#ifndef BOKF_COMMANDS_H +#define BOKF_COMMANDS_H + +#include <stddef.h> + +#include "protocol.h" + +enum cmd_perm { + PERM_PUBLIC = 0, + PERM_READ, + PERM_WRITE, + PERM_OWNER, + PERM_ADMIN +}; + +struct command { + const char *name; + const char *summary; + enum cmd_perm perm; + int need_org; + int mutating; + int dry_run; + yyjson_mut_val *(*fn)(struct req *r); +}; + +extern const struct command g_commands[]; +extern const size_t g_commands_count; + +const struct command *command_find(const char *name); +const char *perm_name(enum cmd_perm p); +const char *perm_scope(enum cmd_perm p); + +#endif |
