From 60abd7d823771297f8b25072e1c5b8c190a6dba5 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Tue, 23 Aug 2022 09:17:28 -0500 Subject: [PATCH 1/4] Initial Protocol Buffers --- proto/ensign/v1beta1/ensign.proto | 48 +++++++++++++++++++++++++++++ proto/ensign/v1beta1/event.proto | 50 +++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 proto/ensign/v1beta1/ensign.proto create mode 100644 proto/ensign/v1beta1/event.proto diff --git a/proto/ensign/v1beta1/ensign.proto b/proto/ensign/v1beta1/ensign.proto new file mode 100644 index 000000000..a8d7da59e --- /dev/null +++ b/proto/ensign/v1beta1/ensign.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package ensign.v1beta1; +option go_package = "github.com/rotationalio/ensign/pkg/api/v1beta1;api"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + + +service Ensign { + rpc Status(HealthCheck) returns (ServiceState) {} +} + + +message HealthCheck { + // The number of failed health checks that proceeded the current check. + uint32 attempts = 1; + + // The timestamp of the last health check, successful or otherwise. + google.protobuf.Timestamp last_checked_at = 2; +} + +message ServiceState { + enum Status { + UNKNOWN = 0; + HEALTHY = 1; + UNHEALTHY = 2; + DANGER = 3; + OFFLINE = 4; + MAINTENANCE = 5; + } + + // Current service status as defined by the recieving system. The system is obliged + // to respond with the closest matching status in a best-effort fashion. Alerts will + // be triggered on service status changes if the system does not respond and the + // previous system state was not unknown. + Status status = 1; + + // The current version of the node running the Ensign service + string version = 2; + + // How long the node has been up and running since it was last rebooted + google.protobuf.Duration uptime = 3; + + // Hint to the client when to check the health status again. + google.protobuf.Timestamp not_before = 4; + google.protobuf.Timestamp not_after = 5; +} \ No newline at end of file diff --git a/proto/ensign/v1beta1/event.proto b/proto/ensign/v1beta1/event.proto new file mode 100644 index 000000000..c2766ac0f --- /dev/null +++ b/proto/ensign/v1beta1/event.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package ensign.v1beta1; +option go_package = "github.com/rotationalio/ensign/pkg/api/v1beta1;api"; + +import "google/protobuf/timestamp.proto"; + +// Event is a high level wrapper for a datagram that is totally ordered by the Ensign +// event-driven framework. Events are simply blobs of data and associated metadata that +// can be published by a producer, inserted into a log, and consumed by a subsriber. +// TODO: change mimetype to an enum +// TODO: how should we implement the event IDs? +message Event { + string id = 1; + string mimetype = 2; + Type type = 3; + + bytes data = 4; + + Encryption encryption = 5; + Compression compression = 6; + Region geography = 7; + Publisher publisher = 8; + + google.protobuf.Timestamp created = 14; + google.protobuf.Timestamp committed = 15; +} + +message Type { + string name = 1; + uint32 version = 2; +} + +message Encryption { + string algorithm = 1; + string keyid = 2; +} + +message Compression { + string algorithm = 2; +} + +message Region { + string name = 1; +} + +message Publisher { + string client_id = 1; + string ipaddr = 2; +} \ No newline at end of file From bd47ef4a10e3921e2cbff794aa516eca4342a159 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Tue, 23 Aug 2022 12:04:39 -0500 Subject: [PATCH 2/4] topics and api rpcs --- go.mod | 13 + go.sum | 128 ++++ pkg/api/generate.go | 3 + pkg/api/v1beta1/ensign.pb.go | 1039 +++++++++++++++++++++++++++++ pkg/api/v1beta1/ensign_grpc.pb.go | 350 ++++++++++ pkg/api/v1beta1/event.pb.go | 610 +++++++++++++++++ pkg/api/v1beta1/topic.pb.go | 542 +++++++++++++++ proto/ensign/v1beta1/ensign.proto | 51 ++ proto/ensign/v1beta1/event.proto | 17 +- proto/ensign/v1beta1/topic.proto | 45 ++ 10 files changed, 2790 insertions(+), 8 deletions(-) create mode 100644 go.sum create mode 100644 pkg/api/generate.go create mode 100644 pkg/api/v1beta1/ensign.pb.go create mode 100644 pkg/api/v1beta1/ensign_grpc.pb.go create mode 100644 pkg/api/v1beta1/event.pb.go create mode 100644 pkg/api/v1beta1/topic.pb.go create mode 100644 proto/ensign/v1beta1/topic.proto diff --git a/go.mod b/go.mod index 067da08e3..bb9c8a289 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,16 @@ module github.com/rotationalio/ensign go 1.18 + +require ( + google.golang.org/grpc v1.48.0 + google.golang.org/protobuf v1.28.1 +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/text v0.3.3 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..eafeb52f1 --- /dev/null +++ b/go.sum @@ -0,0 +1,128 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/api/generate.go b/pkg/api/generate.go new file mode 100644 index 000000000..e88d30a9a --- /dev/null +++ b/pkg/api/generate.go @@ -0,0 +1,3 @@ +package api + +//go:generate protoc -I=$GOPATH/src/github.com/rotationalio/ensign/proto --go_out=. --go_opt=module=github.com/rotationalio/ensign/pkg/api --go-grpc_out=. --go-grpc_opt=module=github.com/rotationalio/ensign/pkg/api ensign/v1beta1/event.proto ensign/v1beta1/topic.proto ensign/v1beta1/ensign.proto diff --git a/pkg/api/v1beta1/ensign.pb.go b/pkg/api/v1beta1/ensign.pb.go new file mode 100644 index 000000000..6ccc5cd17 --- /dev/null +++ b/pkg/api/v1beta1/ensign.pb.go @@ -0,0 +1,1039 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.21.5 +// source: ensign/v1beta1/ensign.proto + +package api + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ServiceState_Status int32 + +const ( + ServiceState_UNKNOWN ServiceState_Status = 0 + ServiceState_HEALTHY ServiceState_Status = 1 + ServiceState_UNHEALTHY ServiceState_Status = 2 + ServiceState_DANGER ServiceState_Status = 3 + ServiceState_OFFLINE ServiceState_Status = 4 + ServiceState_MAINTENANCE ServiceState_Status = 5 +) + +// Enum value maps for ServiceState_Status. +var ( + ServiceState_Status_name = map[int32]string{ + 0: "UNKNOWN", + 1: "HEALTHY", + 2: "UNHEALTHY", + 3: "DANGER", + 4: "OFFLINE", + 5: "MAINTENANCE", + } + ServiceState_Status_value = map[string]int32{ + "UNKNOWN": 0, + "HEALTHY": 1, + "UNHEALTHY": 2, + "DANGER": 3, + "OFFLINE": 4, + "MAINTENANCE": 5, + } +) + +func (x ServiceState_Status) Enum() *ServiceState_Status { + p := new(ServiceState_Status) + *p = x + return p +} + +func (x ServiceState_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ServiceState_Status) Descriptor() protoreflect.EnumDescriptor { + return file_ensign_v1beta1_ensign_proto_enumTypes[0].Descriptor() +} + +func (ServiceState_Status) Type() protoreflect.EnumType { + return &file_ensign_v1beta1_ensign_proto_enumTypes[0] +} + +func (x ServiceState_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ServiceState_Status.Descriptor instead. +func (ServiceState_Status) EnumDescriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{7, 0} +} + +type Publication struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Embed: + // *Publication_Ack + // *Publication_Nack + // *Publication_CloseStream + Embed isPublication_Embed `protobuf_oneof:"embed"` +} + +func (x *Publication) Reset() { + *x = Publication{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Publication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Publication) ProtoMessage() {} + +func (x *Publication) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Publication.ProtoReflect.Descriptor instead. +func (*Publication) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{0} +} + +func (m *Publication) GetEmbed() isPublication_Embed { + if m != nil { + return m.Embed + } + return nil +} + +func (x *Publication) GetAck() *Ack { + if x, ok := x.GetEmbed().(*Publication_Ack); ok { + return x.Ack + } + return nil +} + +func (x *Publication) GetNack() *Nack { + if x, ok := x.GetEmbed().(*Publication_Nack); ok { + return x.Nack + } + return nil +} + +func (x *Publication) GetCloseStream() *CloseStream { + if x, ok := x.GetEmbed().(*Publication_CloseStream); ok { + return x.CloseStream + } + return nil +} + +type isPublication_Embed interface { + isPublication_Embed() +} + +type Publication_Ack struct { + Ack *Ack `protobuf:"bytes,1,opt,name=ack,proto3,oneof"` +} + +type Publication_Nack struct { + Nack *Nack `protobuf:"bytes,2,opt,name=nack,proto3,oneof"` +} + +type Publication_CloseStream struct { + CloseStream *CloseStream `protobuf:"bytes,3,opt,name=close_stream,json=closeStream,proto3,oneof"` +} + +func (*Publication_Ack) isPublication_Embed() {} + +func (*Publication_Nack) isPublication_Embed() {} + +func (*Publication_CloseStream) isPublication_Embed() {} + +type Subscription struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Embed: + // *Subscription_Ack + // *Subscription_Nack + // *Subscription_OpenStream + Embed isSubscription_Embed `protobuf_oneof:"embed"` +} + +func (x *Subscription) Reset() { + *x = Subscription{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Subscription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Subscription) ProtoMessage() {} + +func (x *Subscription) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Subscription.ProtoReflect.Descriptor instead. +func (*Subscription) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{1} +} + +func (m *Subscription) GetEmbed() isSubscription_Embed { + if m != nil { + return m.Embed + } + return nil +} + +func (x *Subscription) GetAck() *Ack { + if x, ok := x.GetEmbed().(*Subscription_Ack); ok { + return x.Ack + } + return nil +} + +func (x *Subscription) GetNack() *Nack { + if x, ok := x.GetEmbed().(*Subscription_Nack); ok { + return x.Nack + } + return nil +} + +func (x *Subscription) GetOpenStream() *OpenStream { + if x, ok := x.GetEmbed().(*Subscription_OpenStream); ok { + return x.OpenStream + } + return nil +} + +type isSubscription_Embed interface { + isSubscription_Embed() +} + +type Subscription_Ack struct { + Ack *Ack `protobuf:"bytes,1,opt,name=ack,proto3,oneof"` +} + +type Subscription_Nack struct { + Nack *Nack `protobuf:"bytes,2,opt,name=nack,proto3,oneof"` +} + +type Subscription_OpenStream struct { + OpenStream *OpenStream `protobuf:"bytes,3,opt,name=open_stream,json=openStream,proto3,oneof"` +} + +func (*Subscription_Ack) isSubscription_Embed() {} + +func (*Subscription_Nack) isSubscription_Embed() {} + +func (*Subscription_OpenStream) isSubscription_Embed() {} + +type Ack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Committed *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=committed,proto3" json:"committed,omitempty"` +} + +func (x *Ack) Reset() { + *x = Ack{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ack) ProtoMessage() {} + +func (x *Ack) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ack.ProtoReflect.Descriptor instead. +func (*Ack) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{2} +} + +func (x *Ack) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Ack) GetCommitted() *timestamppb.Timestamp { + if x != nil { + return x.Committed + } + return nil +} + +type Nack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Code uint32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` + Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *Nack) Reset() { + *x = Nack{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Nack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Nack) ProtoMessage() {} + +func (x *Nack) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Nack.ProtoReflect.Descriptor instead. +func (*Nack) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{3} +} + +func (x *Nack) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Nack) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Nack) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type OpenStream struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` + Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` +} + +func (x *OpenStream) Reset() { + *x = OpenStream{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OpenStream) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenStream) ProtoMessage() {} + +func (x *OpenStream) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OpenStream.ProtoReflect.Descriptor instead. +func (*OpenStream) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{4} +} + +func (x *OpenStream) GetTopic() string { + if x != nil { + return x.Topic + } + return "" +} + +func (x *OpenStream) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +type CloseStream struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events uint64 `protobuf:"varint,1,opt,name=events,proto3" json:"events,omitempty"` + TopicOffset uint64 `protobuf:"varint,2,opt,name=topic_offset,json=topicOffset,proto3" json:"topic_offset,omitempty"` + Consumers uint64 `protobuf:"varint,3,opt,name=consumers,proto3" json:"consumers,omitempty"` +} + +func (x *CloseStream) Reset() { + *x = CloseStream{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseStream) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseStream) ProtoMessage() {} + +func (x *CloseStream) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloseStream.ProtoReflect.Descriptor instead. +func (*CloseStream) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{5} +} + +func (x *CloseStream) GetEvents() uint64 { + if x != nil { + return x.Events + } + return 0 +} + +func (x *CloseStream) GetTopicOffset() uint64 { + if x != nil { + return x.TopicOffset + } + return 0 +} + +func (x *CloseStream) GetConsumers() uint64 { + if x != nil { + return x.Consumers + } + return 0 +} + +type HealthCheck struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The number of failed health checks that proceeded the current check. + Attempts uint32 `protobuf:"varint,1,opt,name=attempts,proto3" json:"attempts,omitempty"` + // The timestamp of the last health check, successful or otherwise. + LastCheckedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_checked_at,json=lastCheckedAt,proto3" json:"last_checked_at,omitempty"` +} + +func (x *HealthCheck) Reset() { + *x = HealthCheck{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheck) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheck) ProtoMessage() {} + +func (x *HealthCheck) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheck.ProtoReflect.Descriptor instead. +func (*HealthCheck) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{6} +} + +func (x *HealthCheck) GetAttempts() uint32 { + if x != nil { + return x.Attempts + } + return 0 +} + +func (x *HealthCheck) GetLastCheckedAt() *timestamppb.Timestamp { + if x != nil { + return x.LastCheckedAt + } + return nil +} + +type ServiceState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Current service status as defined by the recieving system. The system is obliged + // to respond with the closest matching status in a best-effort fashion. Alerts will + // be triggered on service status changes if the system does not respond and the + // previous system state was not unknown. + Status ServiceState_Status `protobuf:"varint,1,opt,name=status,proto3,enum=ensign.v1beta1.ServiceState_Status" json:"status,omitempty"` + // The current version of the node running the Ensign service + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // How long the node has been up and running since it was last rebooted + Uptime *durationpb.Duration `protobuf:"bytes,3,opt,name=uptime,proto3" json:"uptime,omitempty"` + // Hint to the client when to check the health status again. + NotBefore *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=not_before,json=notBefore,proto3" json:"not_before,omitempty"` + NotAfter *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=not_after,json=notAfter,proto3" json:"not_after,omitempty"` +} + +func (x *ServiceState) Reset() { + *x = ServiceState{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServiceState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServiceState) ProtoMessage() {} + +func (x *ServiceState) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServiceState.ProtoReflect.Descriptor instead. +func (*ServiceState) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{7} +} + +func (x *ServiceState) GetStatus() ServiceState_Status { + if x != nil { + return x.Status + } + return ServiceState_UNKNOWN +} + +func (x *ServiceState) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ServiceState) GetUptime() *durationpb.Duration { + if x != nil { + return x.Uptime + } + return nil +} + +func (x *ServiceState) GetNotBefore() *timestamppb.Timestamp { + if x != nil { + return x.NotBefore + } + return nil +} + +func (x *ServiceState) GetNotAfter() *timestamppb.Timestamp { + if x != nil { + return x.NotAfter + } + return nil +} + +type PageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *PageInfo) Reset() { + *x = PageInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageInfo) ProtoMessage() {} + +func (x *PageInfo) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_ensign_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PageInfo.ProtoReflect.Descriptor instead. +func (*PageInfo) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_ensign_proto_rawDescGZIP(), []int{8} +} + +func (x *PageInfo) GetPageSize() uint32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *PageInfo) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +var File_ensign_v1beta1_ensign_proto protoreflect.FileDescriptor + +var file_ensign_v1beta1_ensign_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, + 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1a, 0x65, + 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x65, 0x6e, 0x73, 0x69, 0x67, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x03, 0x61, 0x63, 0x6b, 0x12, + 0x2a, 0x0a, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, + 0x61, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x12, 0x40, 0x0a, 0x0c, 0x63, + 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x48, 0x00, + 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x07, 0x0a, + 0x05, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x22, 0xab, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x03, 0x61, 0x63, 0x6b, + 0x12, 0x2a, 0x0a, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4e, 0x61, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x63, 0x6b, 0x12, 0x3d, 0x0a, 0x0b, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x48, 0x00, 0x52, + 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x65, + 0x6d, 0x62, 0x65, 0x64, 0x22, 0x4f, 0x0a, 0x03, 0x41, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x64, 0x22, 0x40, 0x0a, 0x04, 0x4e, 0x61, 0x63, 0x6b, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x38, 0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x6e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x22, 0x66, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x16, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x0b, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x74, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x22, 0xe9, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x73, 0x69, + 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x31, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x75, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x37, + 0x0a, 0x09, 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x6e, + 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, + 0x4e, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x41, + 0x4e, 0x47, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, + 0x45, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, + 0x43, 0x45, 0x10, 0x05, 0x22, 0x4f, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x0a, + 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xac, 0x03, 0x0a, 0x06, 0x45, 0x6e, 0x73, 0x69, 0x67, 0x6e, + 0x12, 0x43, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x15, 0x2e, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x15, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x44, 0x0a, + 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x18, 0x2e, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x1a, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x50, 0x61, 0x67, + 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x70, + 0x69, 0x63, 0x12, 0x15, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x1a, 0x15, 0x2e, 0x65, 0x6e, 0x73, 0x69, + 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, + 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, + 0x63, 0x12, 0x18, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x6f, 0x64, 0x1a, 0x1e, 0x2e, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, + 0x69, 0x63, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1c, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x22, 0x00, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x6f, 0x2f, + 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_ensign_v1beta1_ensign_proto_rawDescOnce sync.Once + file_ensign_v1beta1_ensign_proto_rawDescData = file_ensign_v1beta1_ensign_proto_rawDesc +) + +func file_ensign_v1beta1_ensign_proto_rawDescGZIP() []byte { + file_ensign_v1beta1_ensign_proto_rawDescOnce.Do(func() { + file_ensign_v1beta1_ensign_proto_rawDescData = protoimpl.X.CompressGZIP(file_ensign_v1beta1_ensign_proto_rawDescData) + }) + return file_ensign_v1beta1_ensign_proto_rawDescData +} + +var file_ensign_v1beta1_ensign_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ensign_v1beta1_ensign_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_ensign_v1beta1_ensign_proto_goTypes = []interface{}{ + (ServiceState_Status)(0), // 0: ensign.v1beta1.ServiceState.Status + (*Publication)(nil), // 1: ensign.v1beta1.Publication + (*Subscription)(nil), // 2: ensign.v1beta1.Subscription + (*Ack)(nil), // 3: ensign.v1beta1.Ack + (*Nack)(nil), // 4: ensign.v1beta1.Nack + (*OpenStream)(nil), // 5: ensign.v1beta1.OpenStream + (*CloseStream)(nil), // 6: ensign.v1beta1.CloseStream + (*HealthCheck)(nil), // 7: ensign.v1beta1.HealthCheck + (*ServiceState)(nil), // 8: ensign.v1beta1.ServiceState + (*PageInfo)(nil), // 9: ensign.v1beta1.PageInfo + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 11: google.protobuf.Duration + (*Event)(nil), // 12: ensign.v1beta1.Event + (*Topic)(nil), // 13: ensign.v1beta1.Topic + (*TopicMod)(nil), // 14: ensign.v1beta1.TopicMod + (*TopicsPage)(nil), // 15: ensign.v1beta1.TopicsPage + (*TopicTombstone)(nil), // 16: ensign.v1beta1.TopicTombstone +} +var file_ensign_v1beta1_ensign_proto_depIdxs = []int32{ + 3, // 0: ensign.v1beta1.Publication.ack:type_name -> ensign.v1beta1.Ack + 4, // 1: ensign.v1beta1.Publication.nack:type_name -> ensign.v1beta1.Nack + 6, // 2: ensign.v1beta1.Publication.close_stream:type_name -> ensign.v1beta1.CloseStream + 3, // 3: ensign.v1beta1.Subscription.ack:type_name -> ensign.v1beta1.Ack + 4, // 4: ensign.v1beta1.Subscription.nack:type_name -> ensign.v1beta1.Nack + 5, // 5: ensign.v1beta1.Subscription.open_stream:type_name -> ensign.v1beta1.OpenStream + 10, // 6: ensign.v1beta1.Ack.committed:type_name -> google.protobuf.Timestamp + 10, // 7: ensign.v1beta1.HealthCheck.last_checked_at:type_name -> google.protobuf.Timestamp + 0, // 8: ensign.v1beta1.ServiceState.status:type_name -> ensign.v1beta1.ServiceState.Status + 11, // 9: ensign.v1beta1.ServiceState.uptime:type_name -> google.protobuf.Duration + 10, // 10: ensign.v1beta1.ServiceState.not_before:type_name -> google.protobuf.Timestamp + 10, // 11: ensign.v1beta1.ServiceState.not_after:type_name -> google.protobuf.Timestamp + 12, // 12: ensign.v1beta1.Ensign.Publish:input_type -> ensign.v1beta1.Event + 2, // 13: ensign.v1beta1.Ensign.Subscribe:input_type -> ensign.v1beta1.Subscription + 9, // 14: ensign.v1beta1.Ensign.ListTopics:input_type -> ensign.v1beta1.PageInfo + 13, // 15: ensign.v1beta1.Ensign.CreateTopic:input_type -> ensign.v1beta1.Topic + 14, // 16: ensign.v1beta1.Ensign.DeleteTopic:input_type -> ensign.v1beta1.TopicMod + 7, // 17: ensign.v1beta1.Ensign.Status:input_type -> ensign.v1beta1.HealthCheck + 1, // 18: ensign.v1beta1.Ensign.Publish:output_type -> ensign.v1beta1.Publication + 12, // 19: ensign.v1beta1.Ensign.Subscribe:output_type -> ensign.v1beta1.Event + 15, // 20: ensign.v1beta1.Ensign.ListTopics:output_type -> ensign.v1beta1.TopicsPage + 13, // 21: ensign.v1beta1.Ensign.CreateTopic:output_type -> ensign.v1beta1.Topic + 16, // 22: ensign.v1beta1.Ensign.DeleteTopic:output_type -> ensign.v1beta1.TopicTombstone + 8, // 23: ensign.v1beta1.Ensign.Status:output_type -> ensign.v1beta1.ServiceState + 18, // [18:24] is the sub-list for method output_type + 12, // [12:18] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_ensign_v1beta1_ensign_proto_init() } +func file_ensign_v1beta1_ensign_proto_init() { + if File_ensign_v1beta1_ensign_proto != nil { + return + } + file_ensign_v1beta1_event_proto_init() + file_ensign_v1beta1_topic_proto_init() + if !protoimpl.UnsafeEnabled { + file_ensign_v1beta1_ensign_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Publication); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Subscription); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Nack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenStream); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseStream); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheck); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServiceState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PageInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_ensign_v1beta1_ensign_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Publication_Ack)(nil), + (*Publication_Nack)(nil), + (*Publication_CloseStream)(nil), + } + file_ensign_v1beta1_ensign_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Subscription_Ack)(nil), + (*Subscription_Nack)(nil), + (*Subscription_OpenStream)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ensign_v1beta1_ensign_proto_rawDesc, + NumEnums: 1, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ensign_v1beta1_ensign_proto_goTypes, + DependencyIndexes: file_ensign_v1beta1_ensign_proto_depIdxs, + EnumInfos: file_ensign_v1beta1_ensign_proto_enumTypes, + MessageInfos: file_ensign_v1beta1_ensign_proto_msgTypes, + }.Build() + File_ensign_v1beta1_ensign_proto = out.File + file_ensign_v1beta1_ensign_proto_rawDesc = nil + file_ensign_v1beta1_ensign_proto_goTypes = nil + file_ensign_v1beta1_ensign_proto_depIdxs = nil +} diff --git a/pkg/api/v1beta1/ensign_grpc.pb.go b/pkg/api/v1beta1/ensign_grpc.pb.go new file mode 100644 index 000000000..3d4be6604 --- /dev/null +++ b/pkg/api/v1beta1/ensign_grpc.pb.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.5 +// source: ensign/v1beta1/ensign.proto + +package api + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// EnsignClient is the client API for Ensign service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EnsignClient interface { + Publish(ctx context.Context, opts ...grpc.CallOption) (Ensign_PublishClient, error) + Subscribe(ctx context.Context, opts ...grpc.CallOption) (Ensign_SubscribeClient, error) + ListTopics(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*TopicsPage, error) + CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) + DeleteTopic(ctx context.Context, in *TopicMod, opts ...grpc.CallOption) (*TopicTombstone, error) + Status(ctx context.Context, in *HealthCheck, opts ...grpc.CallOption) (*ServiceState, error) +} + +type ensignClient struct { + cc grpc.ClientConnInterface +} + +func NewEnsignClient(cc grpc.ClientConnInterface) EnsignClient { + return &ensignClient{cc} +} + +func (c *ensignClient) Publish(ctx context.Context, opts ...grpc.CallOption) (Ensign_PublishClient, error) { + stream, err := c.cc.NewStream(ctx, &Ensign_ServiceDesc.Streams[0], "/ensign.v1beta1.Ensign/Publish", opts...) + if err != nil { + return nil, err + } + x := &ensignPublishClient{stream} + return x, nil +} + +type Ensign_PublishClient interface { + Send(*Event) error + Recv() (*Publication, error) + grpc.ClientStream +} + +type ensignPublishClient struct { + grpc.ClientStream +} + +func (x *ensignPublishClient) Send(m *Event) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ensignPublishClient) Recv() (*Publication, error) { + m := new(Publication) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ensignClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (Ensign_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &Ensign_ServiceDesc.Streams[1], "/ensign.v1beta1.Ensign/Subscribe", opts...) + if err != nil { + return nil, err + } + x := &ensignSubscribeClient{stream} + return x, nil +} + +type Ensign_SubscribeClient interface { + Send(*Subscription) error + Recv() (*Event, error) + grpc.ClientStream +} + +type ensignSubscribeClient struct { + grpc.ClientStream +} + +func (x *ensignSubscribeClient) Send(m *Subscription) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ensignSubscribeClient) Recv() (*Event, error) { + m := new(Event) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ensignClient) ListTopics(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*TopicsPage, error) { + out := new(TopicsPage) + err := c.cc.Invoke(ctx, "/ensign.v1beta1.Ensign/ListTopics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ensignClient) CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := c.cc.Invoke(ctx, "/ensign.v1beta1.Ensign/CreateTopic", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ensignClient) DeleteTopic(ctx context.Context, in *TopicMod, opts ...grpc.CallOption) (*TopicTombstone, error) { + out := new(TopicTombstone) + err := c.cc.Invoke(ctx, "/ensign.v1beta1.Ensign/DeleteTopic", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ensignClient) Status(ctx context.Context, in *HealthCheck, opts ...grpc.CallOption) (*ServiceState, error) { + out := new(ServiceState) + err := c.cc.Invoke(ctx, "/ensign.v1beta1.Ensign/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EnsignServer is the server API for Ensign service. +// All implementations must embed UnimplementedEnsignServer +// for forward compatibility +type EnsignServer interface { + Publish(Ensign_PublishServer) error + Subscribe(Ensign_SubscribeServer) error + ListTopics(context.Context, *PageInfo) (*TopicsPage, error) + CreateTopic(context.Context, *Topic) (*Topic, error) + DeleteTopic(context.Context, *TopicMod) (*TopicTombstone, error) + Status(context.Context, *HealthCheck) (*ServiceState, error) + mustEmbedUnimplementedEnsignServer() +} + +// UnimplementedEnsignServer must be embedded to have forward compatible implementations. +type UnimplementedEnsignServer struct { +} + +func (UnimplementedEnsignServer) Publish(Ensign_PublishServer) error { + return status.Errorf(codes.Unimplemented, "method Publish not implemented") +} +func (UnimplementedEnsignServer) Subscribe(Ensign_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedEnsignServer) ListTopics(context.Context, *PageInfo) (*TopicsPage, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTopics not implemented") +} +func (UnimplementedEnsignServer) CreateTopic(context.Context, *Topic) (*Topic, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateTopic not implemented") +} +func (UnimplementedEnsignServer) DeleteTopic(context.Context, *TopicMod) (*TopicTombstone, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteTopic not implemented") +} +func (UnimplementedEnsignServer) Status(context.Context, *HealthCheck) (*ServiceState, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedEnsignServer) mustEmbedUnimplementedEnsignServer() {} + +// UnsafeEnsignServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EnsignServer will +// result in compilation errors. +type UnsafeEnsignServer interface { + mustEmbedUnimplementedEnsignServer() +} + +func RegisterEnsignServer(s grpc.ServiceRegistrar, srv EnsignServer) { + s.RegisterService(&Ensign_ServiceDesc, srv) +} + +func _Ensign_Publish_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EnsignServer).Publish(&ensignPublishServer{stream}) +} + +type Ensign_PublishServer interface { + Send(*Publication) error + Recv() (*Event, error) + grpc.ServerStream +} + +type ensignPublishServer struct { + grpc.ServerStream +} + +func (x *ensignPublishServer) Send(m *Publication) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ensignPublishServer) Recv() (*Event, error) { + m := new(Event) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Ensign_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EnsignServer).Subscribe(&ensignSubscribeServer{stream}) +} + +type Ensign_SubscribeServer interface { + Send(*Event) error + Recv() (*Subscription, error) + grpc.ServerStream +} + +type ensignSubscribeServer struct { + grpc.ServerStream +} + +func (x *ensignSubscribeServer) Send(m *Event) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ensignSubscribeServer) Recv() (*Subscription, error) { + m := new(Subscription) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Ensign_ListTopics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnsignServer).ListTopics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ensign.v1beta1.Ensign/ListTopics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnsignServer).ListTopics(ctx, req.(*PageInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _Ensign_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Topic) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnsignServer).CreateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ensign.v1beta1.Ensign/CreateTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnsignServer).CreateTopic(ctx, req.(*Topic)) + } + return interceptor(ctx, in, info, handler) +} + +func _Ensign_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TopicMod) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnsignServer).DeleteTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ensign.v1beta1.Ensign/DeleteTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnsignServer).DeleteTopic(ctx, req.(*TopicMod)) + } + return interceptor(ctx, in, info, handler) +} + +func _Ensign_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthCheck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnsignServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ensign.v1beta1.Ensign/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnsignServer).Status(ctx, req.(*HealthCheck)) + } + return interceptor(ctx, in, info, handler) +} + +// Ensign_ServiceDesc is the grpc.ServiceDesc for Ensign service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Ensign_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ensign.v1beta1.Ensign", + HandlerType: (*EnsignServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListTopics", + Handler: _Ensign_ListTopics_Handler, + }, + { + MethodName: "CreateTopic", + Handler: _Ensign_CreateTopic_Handler, + }, + { + MethodName: "DeleteTopic", + Handler: _Ensign_DeleteTopic_Handler, + }, + { + MethodName: "Status", + Handler: _Ensign_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Publish", + Handler: _Ensign_Publish_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Subscribe", + Handler: _Ensign_Subscribe_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "ensign/v1beta1/ensign.proto", +} diff --git a/pkg/api/v1beta1/event.pb.go b/pkg/api/v1beta1/event.pb.go new file mode 100644 index 000000000..ee01995d5 --- /dev/null +++ b/pkg/api/v1beta1/event.pb.go @@ -0,0 +1,610 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.21.5 +// source: ensign/v1beta1/event.proto + +package api + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Event is a high level wrapper for a datagram that is totally ordered by the Ensign +// event-driven framework. Events are simply blobs of data and associated metadata that +// can be published by a producer, inserted into a log, and consumed by a subsriber. +// TODO: change mimetype to an enum +// TODO: how should we implement the event IDs? +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + TopicId string `protobuf:"bytes,2,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` + Mimetype string `protobuf:"bytes,3,opt,name=mimetype,proto3" json:"mimetype,omitempty"` + Type *Type `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` + Encryption *Encryption `protobuf:"bytes,6,opt,name=encryption,proto3" json:"encryption,omitempty"` + Compression *Compression `protobuf:"bytes,7,opt,name=compression,proto3" json:"compression,omitempty"` + Geography *Region `protobuf:"bytes,8,opt,name=geography,proto3" json:"geography,omitempty"` + Publisher *Publisher `protobuf:"bytes,9,opt,name=publisher,proto3" json:"publisher,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=created,proto3" json:"created,omitempty"` + Committed *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=committed,proto3" json:"committed,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{0} +} + +func (x *Event) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Event) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +func (x *Event) GetMimetype() string { + if x != nil { + return x.Mimetype + } + return "" +} + +func (x *Event) GetType() *Type { + if x != nil { + return x.Type + } + return nil +} + +func (x *Event) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Event) GetEncryption() *Encryption { + if x != nil { + return x.Encryption + } + return nil +} + +func (x *Event) GetCompression() *Compression { + if x != nil { + return x.Compression + } + return nil +} + +func (x *Event) GetGeography() *Region { + if x != nil { + return x.Geography + } + return nil +} + +func (x *Event) GetPublisher() *Publisher { + if x != nil { + return x.Publisher + } + return nil +} + +func (x *Event) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *Event) GetCommitted() *timestamppb.Timestamp { + if x != nil { + return x.Committed + } + return nil +} + +type Type struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *Type) Reset() { + *x = Type{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Type) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Type) ProtoMessage() {} + +func (x *Type) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Type.ProtoReflect.Descriptor instead. +func (*Type) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{1} +} + +func (x *Type) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Type) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +type Encryption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` +} + +func (x *Encryption) Reset() { + *x = Encryption{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Encryption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Encryption) ProtoMessage() {} + +func (x *Encryption) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Encryption.ProtoReflect.Descriptor instead. +func (*Encryption) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{2} +} + +func (x *Encryption) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +func (x *Encryption) GetKeyId() string { + if x != nil { + return x.KeyId + } + return "" +} + +type Compression struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` +} + +func (x *Compression) Reset() { + *x = Compression{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Compression) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Compression) ProtoMessage() {} + +func (x *Compression) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Compression.ProtoReflect.Descriptor instead. +func (*Compression) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{3} +} + +func (x *Compression) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +type Region struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Region) Reset() { + *x = Region{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Region) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Region) ProtoMessage() {} + +func (x *Region) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Region.ProtoReflect.Descriptor instead. +func (*Region) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{4} +} + +func (x *Region) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Publisher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Ipaddr string `protobuf:"bytes,2,opt,name=ipaddr,proto3" json:"ipaddr,omitempty"` +} + +func (x *Publisher) Reset() { + *x = Publisher{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_event_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Publisher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Publisher) ProtoMessage() {} + +func (x *Publisher) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_event_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Publisher.ProtoReflect.Descriptor instead. +func (*Publisher) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_event_proto_rawDescGZIP(), []int{5} +} + +func (x *Publisher) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *Publisher) GetIpaddr() string { + if x != nil { + return x.Ipaddr + } + return "" +} + +var File_ensign_v1beta1_event_proto protoreflect.FileDescriptor + +var file_ensign_v1beta1_event_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x03, + 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, + 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x0a, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x09, 0x67, 0x65, 0x6f, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6e, 0x73, + 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x67, 0x65, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x79, 0x12, 0x37, 0x0a, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x09, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x22, 0x34, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, 0x0a, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, + 0x2b, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x22, 0x1c, 0x0a, 0x06, + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x40, 0x0a, 0x09, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x61, 0x64, 0x64, 0x72, 0x42, 0x34, 0x5a, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x6f, 0x2f, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, + 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ensign_v1beta1_event_proto_rawDescOnce sync.Once + file_ensign_v1beta1_event_proto_rawDescData = file_ensign_v1beta1_event_proto_rawDesc +) + +func file_ensign_v1beta1_event_proto_rawDescGZIP() []byte { + file_ensign_v1beta1_event_proto_rawDescOnce.Do(func() { + file_ensign_v1beta1_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_ensign_v1beta1_event_proto_rawDescData) + }) + return file_ensign_v1beta1_event_proto_rawDescData +} + +var file_ensign_v1beta1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_ensign_v1beta1_event_proto_goTypes = []interface{}{ + (*Event)(nil), // 0: ensign.v1beta1.Event + (*Type)(nil), // 1: ensign.v1beta1.Type + (*Encryption)(nil), // 2: ensign.v1beta1.Encryption + (*Compression)(nil), // 3: ensign.v1beta1.Compression + (*Region)(nil), // 4: ensign.v1beta1.Region + (*Publisher)(nil), // 5: ensign.v1beta1.Publisher + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_ensign_v1beta1_event_proto_depIdxs = []int32{ + 1, // 0: ensign.v1beta1.Event.type:type_name -> ensign.v1beta1.Type + 2, // 1: ensign.v1beta1.Event.encryption:type_name -> ensign.v1beta1.Encryption + 3, // 2: ensign.v1beta1.Event.compression:type_name -> ensign.v1beta1.Compression + 4, // 3: ensign.v1beta1.Event.geography:type_name -> ensign.v1beta1.Region + 5, // 4: ensign.v1beta1.Event.publisher:type_name -> ensign.v1beta1.Publisher + 6, // 5: ensign.v1beta1.Event.created:type_name -> google.protobuf.Timestamp + 6, // 6: ensign.v1beta1.Event.committed:type_name -> google.protobuf.Timestamp + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_ensign_v1beta1_event_proto_init() } +func file_ensign_v1beta1_event_proto_init() { + if File_ensign_v1beta1_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ensign_v1beta1_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Type); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Encryption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Compression); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_event_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Region); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_event_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Publisher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ensign_v1beta1_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ensign_v1beta1_event_proto_goTypes, + DependencyIndexes: file_ensign_v1beta1_event_proto_depIdxs, + MessageInfos: file_ensign_v1beta1_event_proto_msgTypes, + }.Build() + File_ensign_v1beta1_event_proto = out.File + file_ensign_v1beta1_event_proto_rawDesc = nil + file_ensign_v1beta1_event_proto_goTypes = nil + file_ensign_v1beta1_event_proto_depIdxs = nil +} diff --git a/pkg/api/v1beta1/topic.pb.go b/pkg/api/v1beta1/topic.pb.go new file mode 100644 index 000000000..71d536b9a --- /dev/null +++ b/pkg/api/v1beta1/topic.pb.go @@ -0,0 +1,542 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.21.5 +// source: ensign/v1beta1/topic.proto + +package api + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TopicMod_Operation int32 + +const ( + TopicMod_NOOP TopicMod_Operation = 0 + TopicMod_ARCHIVE TopicMod_Operation = 1 // makes the topic readonly + TopicMod_DESTROY TopicMod_Operation = 2 // deletes the topic and removes all of its data +) + +// Enum value maps for TopicMod_Operation. +var ( + TopicMod_Operation_name = map[int32]string{ + 0: "NOOP", + 1: "ARCHIVE", + 2: "DESTROY", + } + TopicMod_Operation_value = map[string]int32{ + "NOOP": 0, + "ARCHIVE": 1, + "DESTROY": 2, + } +) + +func (x TopicMod_Operation) Enum() *TopicMod_Operation { + p := new(TopicMod_Operation) + *p = x + return p +} + +func (x TopicMod_Operation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TopicMod_Operation) Descriptor() protoreflect.EnumDescriptor { + return file_ensign_v1beta1_topic_proto_enumTypes[0].Descriptor() +} + +func (TopicMod_Operation) Type() protoreflect.EnumType { + return &file_ensign_v1beta1_topic_proto_enumTypes[0] +} + +func (x TopicMod_Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TopicMod_Operation.Descriptor instead. +func (TopicMod_Operation) EnumDescriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{2, 0} +} + +type TopicTombstone_Status int32 + +const ( + TopicTombstone_UNKNOWN TopicTombstone_Status = 0 + TopicTombstone_READONLY TopicTombstone_Status = 1 + TopicTombstone_DELETING TopicTombstone_Status = 2 +) + +// Enum value maps for TopicTombstone_Status. +var ( + TopicTombstone_Status_name = map[int32]string{ + 0: "UNKNOWN", + 1: "READONLY", + 2: "DELETING", + } + TopicTombstone_Status_value = map[string]int32{ + "UNKNOWN": 0, + "READONLY": 1, + "DELETING": 2, + } +) + +func (x TopicTombstone_Status) Enum() *TopicTombstone_Status { + p := new(TopicTombstone_Status) + *p = x + return p +} + +func (x TopicTombstone_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TopicTombstone_Status) Descriptor() protoreflect.EnumDescriptor { + return file_ensign_v1beta1_topic_proto_enumTypes[1].Descriptor() +} + +func (TopicTombstone_Status) Type() protoreflect.EnumType { + return &file_ensign_v1beta1_topic_proto_enumTypes[1] +} + +func (x TopicTombstone_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TopicTombstone_Status.Descriptor instead. +func (TopicTombstone_Status) EnumDescriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{3, 0} +} + +type Topic struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Types []*Type `protobuf:"bytes,3,rep,name=types,proto3" json:"types,omitempty"` + Regions []*Region `protobuf:"bytes,4,rep,name=regions,proto3" json:"regions,omitempty"` + Readonly bool `protobuf:"varint,14,opt,name=readonly,proto3" json:"readonly,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=created,proto3" json:"created,omitempty"` +} + +func (x *Topic) Reset() { + *x = Topic{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Topic) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Topic) ProtoMessage() {} + +func (x *Topic) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Topic.ProtoReflect.Descriptor instead. +func (*Topic) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{0} +} + +func (x *Topic) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Topic) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Topic) GetTypes() []*Type { + if x != nil { + return x.Types + } + return nil +} + +func (x *Topic) GetRegions() []*Region { + if x != nil { + return x.Regions + } + return nil +} + +func (x *Topic) GetReadonly() bool { + if x != nil { + return x.Readonly + } + return false +} + +func (x *Topic) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +type TopicsPage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Topics []*Topic `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *TopicsPage) Reset() { + *x = TopicsPage{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopicsPage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicsPage) ProtoMessage() {} + +func (x *TopicsPage) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicsPage.ProtoReflect.Descriptor instead. +func (*TopicsPage) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{1} +} + +func (x *TopicsPage) GetTopics() []*Topic { + if x != nil { + return x.Topics + } + return nil +} + +func (x *TopicsPage) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type TopicMod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Operation TopicMod_Operation `protobuf:"varint,2,opt,name=operation,proto3,enum=ensign.v1beta1.TopicMod_Operation" json:"operation,omitempty"` +} + +func (x *TopicMod) Reset() { + *x = TopicMod{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopicMod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicMod) ProtoMessage() {} + +func (x *TopicMod) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicMod.ProtoReflect.Descriptor instead. +func (*TopicMod) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{2} +} + +func (x *TopicMod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *TopicMod) GetOperation() TopicMod_Operation { + if x != nil { + return x.Operation + } + return TopicMod_NOOP +} + +type TopicTombstone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State TopicTombstone_Status `protobuf:"varint,2,opt,name=state,proto3,enum=ensign.v1beta1.TopicTombstone_Status" json:"state,omitempty"` +} + +func (x *TopicTombstone) Reset() { + *x = TopicTombstone{} + if protoimpl.UnsafeEnabled { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopicTombstone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicTombstone) ProtoMessage() {} + +func (x *TopicTombstone) ProtoReflect() protoreflect.Message { + mi := &file_ensign_v1beta1_topic_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicTombstone.ProtoReflect.Descriptor instead. +func (*TopicTombstone) Descriptor() ([]byte, []int) { + return file_ensign_v1beta1_topic_proto_rawDescGZIP(), []int{3} +} + +func (x *TopicTombstone) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *TopicTombstone) GetState() TopicTombstone_Status { + if x != nil { + return x.State + } + return TopicTombstone_UNKNOWN +} + +var File_ensign_v1beta1_topic_proto protoreflect.FileDescriptor + +var file_ensign_v1beta1_topic_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1a, 0x65, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x01, 0x0a, 0x05, 0x54, 0x6f, + 0x70, 0x69, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x72, 0x65, + 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, + 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, + 0x79, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x63, 0x0a, 0x0a, 0x54, 0x6f, 0x70, 0x69, 0x63, + 0x73, 0x50, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x06, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, + 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8d, 0x01, 0x0a, + 0x08, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x09, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, + 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, + 0x70, 0x69, 0x63, 0x4d, 0x6f, 0x64, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x09, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4f, 0x50, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, 0x22, 0x90, 0x01, 0x0a, + 0x0e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, + 0x2e, 0x65, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x54, 0x6f, 0x70, 0x69, 0x63, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x41, 0x44, 0x4f, 0x4e, 0x4c, 0x59, 0x10, + 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x42, + 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x6f, 0x2f, 0x65, 0x6e, 0x73, 0x69, 0x67, + 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ensign_v1beta1_topic_proto_rawDescOnce sync.Once + file_ensign_v1beta1_topic_proto_rawDescData = file_ensign_v1beta1_topic_proto_rawDesc +) + +func file_ensign_v1beta1_topic_proto_rawDescGZIP() []byte { + file_ensign_v1beta1_topic_proto_rawDescOnce.Do(func() { + file_ensign_v1beta1_topic_proto_rawDescData = protoimpl.X.CompressGZIP(file_ensign_v1beta1_topic_proto_rawDescData) + }) + return file_ensign_v1beta1_topic_proto_rawDescData +} + +var file_ensign_v1beta1_topic_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_ensign_v1beta1_topic_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_ensign_v1beta1_topic_proto_goTypes = []interface{}{ + (TopicMod_Operation)(0), // 0: ensign.v1beta1.TopicMod.Operation + (TopicTombstone_Status)(0), // 1: ensign.v1beta1.TopicTombstone.Status + (*Topic)(nil), // 2: ensign.v1beta1.Topic + (*TopicsPage)(nil), // 3: ensign.v1beta1.TopicsPage + (*TopicMod)(nil), // 4: ensign.v1beta1.TopicMod + (*TopicTombstone)(nil), // 5: ensign.v1beta1.TopicTombstone + (*Type)(nil), // 6: ensign.v1beta1.Type + (*Region)(nil), // 7: ensign.v1beta1.Region + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp +} +var file_ensign_v1beta1_topic_proto_depIdxs = []int32{ + 6, // 0: ensign.v1beta1.Topic.types:type_name -> ensign.v1beta1.Type + 7, // 1: ensign.v1beta1.Topic.regions:type_name -> ensign.v1beta1.Region + 8, // 2: ensign.v1beta1.Topic.created:type_name -> google.protobuf.Timestamp + 2, // 3: ensign.v1beta1.TopicsPage.topics:type_name -> ensign.v1beta1.Topic + 0, // 4: ensign.v1beta1.TopicMod.operation:type_name -> ensign.v1beta1.TopicMod.Operation + 1, // 5: ensign.v1beta1.TopicTombstone.state:type_name -> ensign.v1beta1.TopicTombstone.Status + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_ensign_v1beta1_topic_proto_init() } +func file_ensign_v1beta1_topic_proto_init() { + if File_ensign_v1beta1_topic_proto != nil { + return + } + file_ensign_v1beta1_event_proto_init() + if !protoimpl.UnsafeEnabled { + file_ensign_v1beta1_topic_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Topic); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_topic_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopicsPage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_topic_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopicMod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ensign_v1beta1_topic_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopicTombstone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ensign_v1beta1_topic_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ensign_v1beta1_topic_proto_goTypes, + DependencyIndexes: file_ensign_v1beta1_topic_proto_depIdxs, + EnumInfos: file_ensign_v1beta1_topic_proto_enumTypes, + MessageInfos: file_ensign_v1beta1_topic_proto_msgTypes, + }.Build() + File_ensign_v1beta1_topic_proto = out.File + file_ensign_v1beta1_topic_proto_rawDesc = nil + file_ensign_v1beta1_topic_proto_goTypes = nil + file_ensign_v1beta1_topic_proto_depIdxs = nil +} diff --git a/proto/ensign/v1beta1/ensign.proto b/proto/ensign/v1beta1/ensign.proto index a8d7da59e..45c27a0fb 100644 --- a/proto/ensign/v1beta1/ensign.proto +++ b/proto/ensign/v1beta1/ensign.proto @@ -3,14 +3,60 @@ syntax = "proto3"; package ensign.v1beta1; option go_package = "github.com/rotationalio/ensign/pkg/api/v1beta1;api"; +import "ensign/v1beta1/event.proto"; +import "ensign/v1beta1/topic.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; service Ensign { + rpc Publish(stream Event) returns (stream Publication) {} + rpc Subscribe(stream Subscription) returns (stream Event) {} + + rpc ListTopics(PageInfo) returns (TopicsPage) {} + rpc CreateTopic(Topic) returns (Topic) {} + rpc DeleteTopic(TopicMod) returns (TopicTombstone) {} + rpc Status(HealthCheck) returns (ServiceState) {} } +message Publication { + oneof embed { + Ack ack = 1; + Nack nack = 2; + CloseStream close_stream = 3; + } +} + +message Subscription { + oneof embed { + Ack ack = 1; + Nack nack = 2; + OpenStream open_stream = 3; + } +} + +message Ack { + string id = 1; + google.protobuf.Timestamp committed = 2; +} + +message Nack { + string id = 1; + uint32 code = 2; + string error = 3; +} + +message OpenStream { + string topic = 1; + string group = 2; +} + +message CloseStream { + uint64 events = 1; + uint64 topic_offset = 2; + uint64 consumers = 3; +} message HealthCheck { // The number of failed health checks that proceeded the current check. @@ -45,4 +91,9 @@ message ServiceState { // Hint to the client when to check the health status again. google.protobuf.Timestamp not_before = 4; google.protobuf.Timestamp not_after = 5; +} + +message PageInfo { + uint32 page_size = 1; + string next_page_token = 2; } \ No newline at end of file diff --git a/proto/ensign/v1beta1/event.proto b/proto/ensign/v1beta1/event.proto index c2766ac0f..896f72d5c 100644 --- a/proto/ensign/v1beta1/event.proto +++ b/proto/ensign/v1beta1/event.proto @@ -12,15 +12,16 @@ import "google/protobuf/timestamp.proto"; // TODO: how should we implement the event IDs? message Event { string id = 1; - string mimetype = 2; - Type type = 3; + string topic_id = 2; + string mimetype = 3; + Type type = 4; - bytes data = 4; + bytes data = 5; - Encryption encryption = 5; - Compression compression = 6; - Region geography = 7; - Publisher publisher = 8; + Encryption encryption = 6; + Compression compression = 7; + Region geography = 8; + Publisher publisher = 9; google.protobuf.Timestamp created = 14; google.protobuf.Timestamp committed = 15; @@ -33,7 +34,7 @@ message Type { message Encryption { string algorithm = 1; - string keyid = 2; + string key_id = 2; } message Compression { diff --git a/proto/ensign/v1beta1/topic.proto b/proto/ensign/v1beta1/topic.proto new file mode 100644 index 000000000..2b8d9b007 --- /dev/null +++ b/proto/ensign/v1beta1/topic.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package ensign.v1beta1; +option go_package = "github.com/rotationalio/ensign/pkg/api/v1beta1;api"; + +import "ensign/v1beta1/event.proto"; +import "google/protobuf/timestamp.proto"; + + +message Topic { + string id = 1; + string name = 2; + repeated Type types = 3; + repeated Region regions = 4; + + bool readonly = 14; + google.protobuf.Timestamp created = 15; +} + +message TopicsPage { + repeated Topic topics = 1; + string next_page_token = 2; +} + +message TopicMod { + enum Operation { + NOOP = 0; + ARCHIVE = 1; // makes the topic readonly + DESTROY = 2; // deletes the topic and removes all of its data + } + + string id = 1; + Operation operation = 2; +} + +message TopicTombstone { + enum Status { + UNKNOWN = 0; + READONLY = 1; + DELETING = 2; + } + + string id = 1; + Status state = 2; +} \ No newline at end of file From ce6eaa0432e938768dfcc00a7f273ad8e12fea98 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Tue, 23 Aug 2022 12:22:59 -0500 Subject: [PATCH 3/4] better pb documentation --- proto/ensign/v1beta1/ensign.proto | 44 ++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/proto/ensign/v1beta1/ensign.proto b/proto/ensign/v1beta1/ensign.proto index 45c27a0fb..67654c19e 100644 --- a/proto/ensign/v1beta1/ensign.proto +++ b/proto/ensign/v1beta1/ensign.proto @@ -8,18 +8,39 @@ import "ensign/v1beta1/topic.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; - +// The Ensign service is meant to allow publishers (producers) and subscribers +// (consumers) of events to interact with the Ensign eventing system; e.g. this is a +// user-oriented API that is the basis of the user SDKs that we will build. There are +// two primary interactions that the user client may have: publishing or subscribing to +// topics to send and receive events or managing topics that are available. service Ensign { + // Both the Publish and Subscribe RPCs are bidirectional streaming to allow for acks + // and nacks of events to be sent between Ensign and the client. The Publish stream + // is opened and the client sends events and receives acks/nacks -- when the client + // closes the publish stream, the server sends back information about the current + // state of the topic. When the Subscribe stream is opened, the client must send an + // open stream message with the subscription info before receiving events. Once it + // receives events it must send back acks/nacks up the stream so that Ensign + // advances the topic offset for the rest of the clients in the group. rpc Publish(stream Event) returns (stream Publication) {} rpc Subscribe(stream Subscription) returns (stream Event) {} + // This is a simple topic management interface. Right now we assume that topics are + // immutable, therefore there is no update topic RPC call. There are two ways to + // delete a topic - archiving it makes the topic readonly so that no events can be + // published to it, but it can still be read. Destroying the topic deletes it and + // removes all of its data, freeing up the topic name to be used again. rpc ListTopics(PageInfo) returns (TopicsPage) {} rpc CreateTopic(Topic) returns (Topic) {} rpc DeleteTopic(TopicMod) returns (TopicTombstone) {} + // Implements a client-side heartbeat that can also be used by monitoring tools. rpc Status(HealthCheck) returns (ServiceState) {} } +// Publication messages are sent back to publishers from the server. Generally they are +// responses to receiving events (e.g. ack and nack) but the last message contains +// information about the performance of the publisher and the topic itself. message Publication { oneof embed { Ack ack = 1; @@ -28,6 +49,10 @@ message Publication { } } +// Subscription messages are sent to the server from subscribers. Generally they are +// responses to receiving events (e.g. ack and nack) but the first message must contain +// subscription information about the topic and the group so that Ensign can start +// sending the client events from the specified topic down the stream. message Subscription { oneof embed { Ack ack = 1; @@ -36,22 +61,38 @@ message Subscription { } } +// Ack represents the receipt and final handling of an event. This datatype should be +// small so that throughput is not affected and generally only contains the ID of the +// event being acknowledged. When Ensign commits an event to the log from the producer, +// the commit timestamp is returned to help determine event latency. When clients ack an +// event back to the Ensign server, they only need contain the id. message Ack { string id = 1; google.protobuf.Timestamp committed = 2; } +// Nack means that an event could not be handled or committed. This datatype should be +// small so that throughput is not affected and generally only conains the id of the +// event and the error code describing what went wrong. Longer error messages are +// optional and should only be used when something abnormal has occurred. The Ensign +// server will return a Nack if the event could not be appended to the log. Clients +// should return a Nack if the event couldn't be handled or processed so that Ensign +// ensures another client retrieves the event. message Nack { string id = 1; uint32 code = 2; string error = 3; } +// OpenStream is the first message that should be sent in a Subscribe stream as it +// defines what topic the client is subscribing to and how it will process the events. message OpenStream { string topic = 1; string group = 2; } +// CloseStream returns some basic stats and topic information to the publisher when the +// stream is closed and provides feedback that the stream was closed successfully. message CloseStream { uint64 events = 1; uint64 topic_offset = 2; @@ -93,6 +134,7 @@ message ServiceState { google.protobuf.Timestamp not_after = 5; } +// A basic request for paginated list queries. message PageInfo { uint32 page_size = 1; string next_page_token = 2; From aba684d7d9248159f3fa22f6416f54a75ad75d53 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Wed, 24 Aug 2022 09:14:27 -0500 Subject: [PATCH 4/4] more documentation on protobufs --- proto/ensign/v1beta1/event.proto | 23 +++++++++++++++++++++-- proto/ensign/v1beta1/topic.proto | 13 ++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/proto/ensign/v1beta1/event.proto b/proto/ensign/v1beta1/event.proto index 896f72d5c..15511b479 100644 --- a/proto/ensign/v1beta1/event.proto +++ b/proto/ensign/v1beta1/event.proto @@ -7,9 +7,14 @@ import "google/protobuf/timestamp.proto"; // Event is a high level wrapper for a datagram that is totally ordered by the Ensign // event-driven framework. Events are simply blobs of data and associated metadata that -// can be published by a producer, inserted into a log, and consumed by a subsriber. +// can be published by a producer, inserted into a log, and consumed by a subscriber. +// The mimetype of the event allows subscribers to deserialize the data into a specific +// format such as JSON or protocol buffers. The type acts as a key for heterogeneous +// topics and can also be used to lookup schema information for data validation. +// TODO: do we need to allow for event keys or is the type sufficient? // TODO: change mimetype to an enum -// TODO: how should we implement the event IDs? +// TODO: how should we implement the event IDs, should we use a time based mechanism like ksuid? +// TODO: is this too nested? should we flatten some of the inner types? message Event { string id = 1; string topic_id = 2; @@ -27,24 +32,38 @@ message Event { google.protobuf.Timestamp committed = 15; } +// An event type is composed of a name and a version so that the type can be looked up +// in the schema registry. The schema can then be used to validate the data inside the +// event. Schemas are optional but types are not unless the mimetype requries a schema +// for deserialization (e.g. protobuf, parquet, avro, etc.). message Type { string name = 1; uint32 version = 2; } +// Metadata about the cryptography used to secure the event. +// TODO: should we encrypt each event individually or blocks of events together? +// TODO: this is only partially implemented message Encryption { string algorithm = 1; string key_id = 2; } +// Metadata about compression used to reduce the storage size of the event. +// TODO: should we compress each event individually or blocks of events together? +// TODO: this is only partially implemented message Compression { string algorithm = 2; } +// Geographic metadata for compliance and region-awareness. +// TODO: this is only partially implemented message Region { string name = 1; } +// Information about the publisher of the event for provenance and auditing purposes. +// TODO: this is only partially implemented message Publisher { string client_id = 1; string ipaddr = 2; diff --git a/proto/ensign/v1beta1/topic.proto b/proto/ensign/v1beta1/topic.proto index 2b8d9b007..a4d2a6aea 100644 --- a/proto/ensign/v1beta1/topic.proto +++ b/proto/ensign/v1beta1/topic.proto @@ -6,7 +6,14 @@ option go_package = "github.com/rotationalio/ensign/pkg/api/v1beta1;api"; import "ensign/v1beta1/event.proto"; import "google/protobuf/timestamp.proto"; - +// Topics are collections of related events and the events inside of a topic are totally +// ordered by ID and their log index. Topics must define the event types and regions +// that they are operated on, which will allow Ensign to determine how to distribute the +// topic over multiple nodes. Users must use the topic ID to connect to a publish or +// subscribe stream. Users can create and delete topics, but for the current +// implementation, topics are immutable -- meaning that they cannot be changed. Topics +// can be deleted in two ways: they can be archived (making them readonly) or they can +// be destroyed, which removes the name of the topic and all the events in the topic. message Topic { string id = 1; string name = 2; @@ -17,11 +24,13 @@ message Topic { google.protobuf.Timestamp created = 15; } +// A list of paginated topics the user can use to identify topic ids to subscribe to. message TopicsPage { repeated Topic topics = 1; string next_page_token = 2; } +// A topic modification operation to archive or destroy the topic. message TopicMod { enum Operation { NOOP = 0; @@ -33,6 +42,8 @@ message TopicMod { Operation operation = 2; } +// A temporary representation of the topic state, e.g. was it modified to be readonly +// or is it in the process of being deleted. Once deleted the topic is permenantly gone. message TopicTombstone { enum Status { UNKNOWN = 0;