|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package plugin.v1; |
| 4 | + |
| 5 | +import "google/protobuf/struct.proto"; |
| 6 | + |
| 7 | +option go_package = "github.com/gatewayd-io/gatewayd-plugin-sdk/plugin/v1"; |
| 8 | + |
| 9 | +service GatewayDPluginService { |
| 10 | + // GetPluginConfig returns the plugin config upon registration |
| 11 | + rpc GetPluginConfig (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 12 | + |
| 13 | + // OnConfigLoaded is called when the config is loaded from any config provider |
| 14 | + rpc OnConfigLoaded (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 15 | + rpc OnNewLogger (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 16 | + rpc OnNewPool (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 17 | + rpc OnNewClient (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 18 | + rpc OnNewProxy (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 19 | + rpc OnNewServer (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 20 | + rpc OnSignal (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 21 | + rpc OnRun (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 22 | + rpc OnBooting (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 23 | + rpc OnBooted (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 24 | + rpc OnOpening (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 25 | + rpc OnOpened (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 26 | + rpc OnClosing (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 27 | + rpc OnClosed (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 28 | + rpc OnTraffic (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 29 | + rpc OnTrafficFromClient (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 30 | + rpc OnTrafficToServer (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 31 | + rpc OnTrafficFromServer (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 32 | + rpc OnTrafficToClient (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 33 | + rpc OnShutdown (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 34 | + rpc OnTick (google.protobuf.Struct) returns (google.protobuf.Struct); |
| 35 | + rpc OnHook (google.protobuf.Struct) returns (google.protobuf.Struct); // Custom hook |
| 36 | +} |
| 37 | + |
| 38 | +enum HookName { |
| 39 | + HOOK_NAME_UNSPECIFIED = 0; |
| 40 | + HOOK_NAME_ON_CONFIG_LOADED = 1; |
| 41 | + HOOK_NAME_ON_NEW_LOGGER = 2; |
| 42 | + HOOK_NAME_ON_NEW_POOL = 3; |
| 43 | + HOOK_NAME_ON_NEW_CLIENT = 4; |
| 44 | + HOOK_NAME_ON_NEW_PROXY = 5; |
| 45 | + HOOK_NAME_ON_NEW_SERVER = 6; |
| 46 | + HOOK_NAME_ON_SIGNAL = 7; |
| 47 | + HOOK_NAME_ON_RUN = 8; |
| 48 | + HOOK_NAME_ON_BOOTING = 9; |
| 49 | + HOOK_NAME_ON_BOOTED = 10; |
| 50 | + HOOK_NAME_ON_OPENING = 11; |
| 51 | + HOOK_NAME_ON_OPENED = 12; |
| 52 | + HOOK_NAME_ON_CLOSING = 13; |
| 53 | + HOOK_NAME_ON_CLOSED = 14; |
| 54 | + HOOK_NAME_ON_TRAFFIC = 15; |
| 55 | + HOOK_NAME_ON_TRAFFIC_FROM_CLIENT = 16; |
| 56 | + HOOK_NAME_ON_TRAFFIC_TO_SERVER = 17; |
| 57 | + HOOK_NAME_ON_TRAFFIC_FROM_SERVER = 18; |
| 58 | + HOOK_NAME_ON_TRAFFIC_TO_CLIENT = 19; |
| 59 | + HOOK_NAME_ON_SHUTDOWN = 20; |
| 60 | + HOOK_NAME_ON_TICK = 21; |
| 61 | + HOOK_NAME_ON_HOOK = 22; |
| 62 | +} |
| 63 | + |
| 64 | +message PluginID { |
| 65 | + string name = 1; |
| 66 | + string version = 2; |
| 67 | + string remote_url = 3; |
| 68 | + string checksum = 4; |
| 69 | +} |
| 70 | + |
| 71 | +message PluginConfig { |
| 72 | + PluginID id = 1; |
| 73 | + string description = 2; |
| 74 | + repeated string authors = 3; |
| 75 | + string license = 4; |
| 76 | + string project_url = 5; |
| 77 | + // internal and external config options |
| 78 | + map<string, string> config = 6; |
| 79 | + // hooks it attaches to |
| 80 | + repeated HookName hooks = 7; |
| 81 | + // required plugins |
| 82 | + map<string, string> requires = 8; |
| 83 | + repeated string tags = 9; |
| 84 | + repeated string categories = 10; |
| 85 | +} |
0 commit comments