diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-07-26 10:54:24 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-07-26 10:54:24 -0400 |
| commit | 7b9862f9410b2ca7d952d6665be02330f63c7174 (patch) | |
| tree | c94bed582e9518322a4dff5563bd5823a9b48d9b /proto | |
| parent | 3773fbdc51ee368589c18b4365dcc4c473e4ddd5 (diff) | |
| download | x-7b9862f9410b2ca7d952d6665be02330f63c7174.tar.xz x-7b9862f9410b2ca7d952d6665be02330f63c7174.zip | |
cmd/mi: remove event support
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'proto')
| -rw-r--r-- | proto/mi.proto | 2 | ||||
| -rw-r--r-- | proto/mi/mi.pb.go | 34 | ||||
| -rw-r--r-- | proto/mi/mi.twirp.go | 380 | ||||
| -rw-r--r-- | proto/mi/mi_grpc.pb.go | 44 |
4 files changed, 394 insertions, 66 deletions
diff --git a/proto/mi.proto b/proto/mi.proto index aa13027..96c7f7f 100644 --- a/proto/mi.proto +++ b/proto/mi.proto @@ -91,4 +91,6 @@ service Events { rpc Get(google.protobuf.Empty) returns (EventFeed); // Add adds an event to the feed. rpc Add(Event) returns (google.protobuf.Empty); + // Remove removes an event from the feed. + rpc Remove(Event) returns (google.protobuf.Empty); }
\ No newline at end of file diff --git a/proto/mi/mi.pb.go b/proto/mi/mi.pb.go index 33fa836..0ec8169 100644 --- a/proto/mi/mi.pb.go +++ b/proto/mi/mi.pb.go @@ -774,7 +774,7 @@ var file_mi_proto_rawDesc = []byte{ 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x42, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x82, 0x01, 0x0a, 0x06, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0xc0, 0x01, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, @@ -783,9 +783,13 @@ var file_mi_proto_rawDesc = []byte{ 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x1b, 0x5a, 0x19, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x2f, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x69, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x3c, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x1a, 0x2e, 0x77, 0x69, 0x74, + 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x6d, 0x69, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1b, + 0x5a, 0x19, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, + 0x2f, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -834,16 +838,18 @@ var file_mi_proto_depIdxs = []int32{ 12, // 14: within.website.x.mi.POSSE.RefreshBlog:input_type -> google.protobuf.Empty 12, // 15: within.website.x.mi.Events.Get:input_type -> google.protobuf.Empty 9, // 16: within.website.x.mi.Events.Add:input_type -> within.website.x.mi.Event - 0, // 17: within.website.x.mi.SwitchTracker.Members:output_type -> within.website.x.mi.MembersResp - 6, // 18: within.website.x.mi.SwitchTracker.WhoIsFront:output_type -> within.website.x.mi.FrontChange - 4, // 19: within.website.x.mi.SwitchTracker.Switch:output_type -> within.website.x.mi.SwitchResp - 6, // 20: within.website.x.mi.SwitchTracker.GetSwitch:output_type -> within.website.x.mi.FrontChange - 8, // 21: within.website.x.mi.SwitchTracker.ListSwitches:output_type -> within.website.x.mi.ListSwitchesResp - 12, // 22: within.website.x.mi.POSSE.RefreshBlog:output_type -> google.protobuf.Empty - 10, // 23: within.website.x.mi.Events.Get:output_type -> within.website.x.mi.EventFeed - 12, // 24: within.website.x.mi.Events.Add:output_type -> google.protobuf.Empty - 17, // [17:25] is the sub-list for method output_type - 9, // [9:17] is the sub-list for method input_type + 9, // 17: within.website.x.mi.Events.Remove:input_type -> within.website.x.mi.Event + 0, // 18: within.website.x.mi.SwitchTracker.Members:output_type -> within.website.x.mi.MembersResp + 6, // 19: within.website.x.mi.SwitchTracker.WhoIsFront:output_type -> within.website.x.mi.FrontChange + 4, // 20: within.website.x.mi.SwitchTracker.Switch:output_type -> within.website.x.mi.SwitchResp + 6, // 21: within.website.x.mi.SwitchTracker.GetSwitch:output_type -> within.website.x.mi.FrontChange + 8, // 22: within.website.x.mi.SwitchTracker.ListSwitches:output_type -> within.website.x.mi.ListSwitchesResp + 12, // 23: within.website.x.mi.POSSE.RefreshBlog:output_type -> google.protobuf.Empty + 10, // 24: within.website.x.mi.Events.Get:output_type -> within.website.x.mi.EventFeed + 12, // 25: within.website.x.mi.Events.Add:output_type -> google.protobuf.Empty + 12, // 26: within.website.x.mi.Events.Remove:output_type -> google.protobuf.Empty + 18, // [18:27] is the sub-list for method output_type + 9, // [9:18] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name 9, // [9:9] is the sub-list for extension extendee 0, // [0:9] is the sub-list for field type_name diff --git a/proto/mi/mi.twirp.go b/proto/mi/mi.twirp.go index 9298f53..73eec5f 100644 --- a/proto/mi/mi.twirp.go +++ b/proto/mi/mi.twirp.go @@ -2144,6 +2144,9 @@ type Events interface { // Add adds an event to the feed. Add(context.Context, *Event) (*google_protobuf.Empty, error) + + // Remove removes an event from the feed. + Remove(context.Context, *Event) (*google_protobuf.Empty, error) } // ====================== @@ -2152,7 +2155,7 @@ type Events interface { type eventsProtobufClient struct { client HTTPClient - urls [2]string + urls [3]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -2180,9 +2183,10 @@ func NewEventsProtobufClient(baseURL string, client HTTPClient, opts ...twirp.Cl // Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method> serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "within.website.x.mi", "Events") - urls := [2]string{ + urls := [3]string{ serviceURL + "Get", serviceURL + "Add", + serviceURL + "Remove", } return &eventsProtobufClient{ @@ -2285,13 +2289,59 @@ func (c *eventsProtobufClient) callAdd(ctx context.Context, in *Event) (*google_ return out, nil } +func (c *eventsProtobufClient) Remove(ctx context.Context, in *Event) (*google_protobuf.Empty, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.mi") + ctx = ctxsetters.WithServiceName(ctx, "Events") + ctx = ctxsetters.WithMethodName(ctx, "Remove") + caller := c.callRemove + if c.interceptor != nil { + caller = func(ctx context.Context, req *Event) (*google_protobuf.Empty, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Event) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Event) when calling interceptor") + } + return c.callRemove(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *eventsProtobufClient) callRemove(ctx context.Context, in *Event) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + // ================== // Events JSON Client // ================== type eventsJSONClient struct { client HTTPClient - urls [2]string + urls [3]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -2319,9 +2369,10 @@ func NewEventsJSONClient(baseURL string, client HTTPClient, opts ...twirp.Client // Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method> serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "within.website.x.mi", "Events") - urls := [2]string{ + urls := [3]string{ serviceURL + "Get", serviceURL + "Add", + serviceURL + "Remove", } return &eventsJSONClient{ @@ -2424,6 +2475,52 @@ func (c *eventsJSONClient) callAdd(ctx context.Context, in *Event) (*google_prot return out, nil } +func (c *eventsJSONClient) Remove(ctx context.Context, in *Event) (*google_protobuf.Empty, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.mi") + ctx = ctxsetters.WithServiceName(ctx, "Events") + ctx = ctxsetters.WithMethodName(ctx, "Remove") + caller := c.callRemove + if c.interceptor != nil { + caller = func(ctx context.Context, req *Event) (*google_protobuf.Empty, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Event) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Event) when calling interceptor") + } + return c.callRemove(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *eventsJSONClient) callRemove(ctx context.Context, in *Event) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + // ===================== // Events Server Handler // ===================== @@ -2527,6 +2624,9 @@ func (s *eventsServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { case "Add": s.serveAdd(ctx, resp, req) return + case "Remove": + s.serveRemove(ctx, resp, req) + return default: msg := fmt.Sprintf("no handler for path %q", req.URL.Path) s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) @@ -2894,6 +2994,186 @@ func (s *eventsServer) serveAddProtobuf(ctx context.Context, resp http.ResponseW callResponseSent(ctx, s.hooks) } +func (s *eventsServer) serveRemove(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveRemoveJSON(ctx, resp, req) + case "application/protobuf": + s.serveRemoveProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *eventsServer) serveRemoveJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "Remove") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(Event) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.Events.Remove + if s.interceptor != nil { + handler = func(ctx context.Context, req *Event) (*google_protobuf.Empty, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Event) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Event) when calling interceptor") + } + return s.Events.Remove(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *google_protobuf.Empty + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *google_protobuf.Empty and nil error while calling Remove. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *eventsServer) serveRemoveProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "Remove") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(Event) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.Events.Remove + if s.interceptor != nil { + handler = func(ctx context.Context, req *Event) (*google_protobuf.Empty, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Event) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Event) when calling interceptor") + } + return s.Events.Remove(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *google_protobuf.Empty + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *google_protobuf.Empty and nil error while calling Remove. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + func (s *eventsServer) ServiceDescriptor() ([]byte, int) { return twirpFileDescriptor0, 2 } @@ -3475,50 +3755,50 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error) } var twirpFileDescriptor0 = []byte{ - // 707 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4b, 0x6f, 0xd3, 0x40, - 0x10, 0x56, 0x92, 0xe6, 0xe1, 0x49, 0x81, 0x6a, 0x41, 0x28, 0x75, 0xa0, 0x0d, 0x16, 0x48, 0x39, - 0x80, 0x23, 0xa5, 0xea, 0xa1, 0x82, 0x0a, 0xf5, 0x95, 0xaa, 0xe2, 0x55, 0xb9, 0x45, 0x48, 0x70, - 0x88, 0x36, 0xf1, 0x34, 0x59, 0x11, 0x3f, 0xba, 0xbb, 0x69, 0xda, 0x2b,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 0xfd, 0x2e, 0x95, 0x69, 0x56, 0xe3, 0xd9, 0x91, 0x64, 0x15, 0x2a, 0x18, 0xfa, 0xfa, - 0x72, 0x49, 0x5d, 0x96, 0x95, 0xbd, 0x23, 0x9d, 0xd7, 0x60, 0xe9, 0x82, 0x1e, 0x9e, 0x93, 0x75, - 0xa8, 0x9a, 0x1a, 0x8a, 0xb7, 0x2e, 0x0e, 0xda, 0xf5, 0x99, 0x06, 0xe8, 0x70, 0x80, 0x14, 0x2d, - 0x62, 0xf2, 0x06, 0x0a, 0xd1, 0x48, 0x73, 0x9c, 0xd7, 0x2c, 0x83, 0x4e, 0x70, 0x49, 0x7f, 0xfb, - 0x63, 0xce, 0x31, 0x94, 0x8a, 0xff, 0x1d, 0x21, 0x29, 0xd6, 0x59, 0x83, 0xe5, 0x43, 0x94, 0xd7, - 0x24, 0x6f, 0x35, 0xc6, 0x99, 0x40, 0xb5, 0xc3, 0xa3, 0x50, 0xee, 0x0d, 0x69, 0x38, 0x40, 0xb2, - 0x01, 0x25, 0xa1, 0xb0, 0xf7, 0xe1, 0x65, 0xa0, 0x49, 0x90, 0xfe, 0xca, 0x85, 0xcc, 0xcc, 0xe4, - 0x0d, 0xd4, 0x79, 0x0b, 0x8f, 0x3e, 0x32, 0x61, 0x98, 0xa1, 0x48, 0xb8, 0x3d, 0x81, 0x62, 0x3f, - 0x1a, 0x87, 0xd2, 0x88, 0x40, 0x1b, 0x89, 0x0e, 0x62, 0x3a, 0x40, 0x33, 0x35, 0x75, 0x76, 0x8e, - 0x61, 0xe5, 0x66, 0xb0, 0x88, 0xc9, 0x3b, 0xa8, 0x08, 0x63, 0x1b, 0x05, 0x36, 0x66, 0xf2, 0xc8, - 0x7c, 0xae, 0x37, 0x8d, 0x70, 0x7e, 0xe7, 0xa1, 0x78, 0x70, 0x81, 0xba, 0x5e, 0x66, 0x7e, 0x5a, - 0x77, 0x2b, 0x50, 0x48, 0x04, 0xa7, 0xa5, 0x98, 0x1c, 0xc9, 0x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, 0xf2, 0x72, 0x66, 0xc4, 0xad, 0xe5, 0xb1, 0x5f, 0xdd, 0x03, 0x25, 0xe2, 0x76, 0x07, - 0x8a, 0xc7, 0x5f, 0x4e, 0x4e, 0x0e, 0xc8, 0x36, 0x54, 0x3d, 0x3c, 0xe3, 0x28, 0x86, 0xbb, 0xa3, - 0x68, 0x30, 0xb7, 0x97, 0x73, 0xfc, 0xed, 0x5f, 0x39, 0x28, 0xa9, 0x91, 0x0b, 0xb2, 0x0d, 0x85, - 0x43, 0x9c, 0x3f, 0x8d, 0xb5, 0xf9, 0x72, 0x51, 0xf2, 0xda, 0x82, 0xc2, 0x8e, 0xef, 0x93, 0x05, - 0xaa, 0x9a, 0x47, 0x62, 0xb7, 0xfe, 0x7d, 0xf5, 0x66, 0x50, 0xeb, 0x52, 0xff, 0xaf, 0x5a, 0x01, - 0xeb, 0x95, 0xd4, 0x69, 0xe3, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x27, 0x04, 0x76, 0xd4, 0x05, - 0x07, 0x00, 0x00, + // 720 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x5d, 0x4f, 0x1b, 0x3b, + 0x10, 0x55, 0x12, 0xb2, 0xc9, 0x4e, 0xb8, 0xf7, 0x22, 0xdf, 0xaa, 0x0a, 0x9b, 0x16, 0xd2, 0x55, + 0x2b, 0xe5, 0xa1, 0xdd, 0x48, 0x41, 0x3c, 0xa0, 0x82, 0x2a, 0xbe, 0x82, 0x50, 0xbf, 0xd0, 0x42, + 0x55, 0xa9, 0x7d, 0x88, 0x9c, 0xec, 0x90, 0x58, 0xcd, 0x7e, 0x60, 0x3b, 0x04, 0x7e, 0x43, 0xdf, + 0xfb, 0x7b, 0xfa, 0xd3, 0xaa, 0xb5, 0x9d, 0xb0, 0xd0, 0x24, 0xd0, 0xbe, 0xd9, 0xe3, 0x73, 0x3c, + 0x67, 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 0xf1, 0xe4, 0xe3, 0xe9, 0xe9, 0x21, 0xd9, 0x81, 0x8a, 0x8f, 0xe7, + 0x1c, 0xc5, 0x60, 0x6f, 0x18, 0xf7, 0xe7, 0xd6, 0x72, 0x4e, 0xbc, 0xf5, 0x33, 0x07, 0x96, 0x6a, + 0xb9, 0x20, 0x3b, 0x50, 0x38, 0xc2, 0xf9, 0xdd, 0x58, 0x9b, 0x6f, 0x17, 0x65, 0xaf, 0x2d, 0x28, + 0xec, 0x06, 0x01, 0x59, 0xe0, 0xaa, 0x79, 0x22, 0xc8, 0x36, 0x58, 0x3e, 0x86, 0xf1, 0x25, 0xfe, + 0x0d, 0x7b, 0xaf, 0xf6, 0x65, 0xf5, 0x36, 0xa9, 0x79, 0xa5, 0xff, 0x76, 0xcd, 0x90, 0x75, 0x2d, + 0xb5, 0xda, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x74, 0x9d, 0x7a, 0x43, 0x07, 0x00, 0x00, } diff --git a/proto/mi/mi_grpc.pb.go b/proto/mi/mi_grpc.pb.go index 9dda097..d9b3756 100644 --- a/proto/mi/mi_grpc.pb.go +++ b/proto/mi/mi_grpc.pb.go @@ -354,8 +354,9 @@ var POSSE_ServiceDesc = grpc.ServiceDesc{ } const ( - Events_Get_FullMethodName = "/within.website.x.mi.Events/Get" - Events_Add_FullMethodName = "/within.website.x.mi.Events/Add" + Events_Get_FullMethodName = "/within.website.x.mi.Events/Get" + Events_Add_FullMethodName = "/within.website.x.mi.Events/Add" + Events_Remove_FullMethodName = "/within.website.x.mi.Events/Remove" ) // EventsClient is the client API for Events service. @@ -368,6 +369,8 @@ type EventsClient interface { Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*EventFeed, error) // Add adds an event to the feed. Add(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Remove removes an event from the feed. + Remove(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) } type eventsClient struct { @@ -398,6 +401,16 @@ func (c *eventsClient) Add(ctx context.Context, in *Event, opts ...grpc.CallOpti return out, nil } +func (c *eventsClient) Remove(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Events_Remove_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // EventsServer is the server API for Events service. // All implementations must embed UnimplementedEventsServer // for forward compatibility @@ -408,6 +421,8 @@ type EventsServer interface { Get(context.Context, *emptypb.Empty) (*EventFeed, error) // Add adds an event to the feed. Add(context.Context, *Event) (*emptypb.Empty, error) + // Remove removes an event from the feed. + Remove(context.Context, *Event) (*emptypb.Empty, error) mustEmbedUnimplementedEventsServer() } @@ -421,6 +436,9 @@ func (UnimplementedEventsServer) Get(context.Context, *emptypb.Empty) (*EventFee func (UnimplementedEventsServer) Add(context.Context, *Event) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") } +func (UnimplementedEventsServer) Remove(context.Context, *Event) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") +} func (UnimplementedEventsServer) mustEmbedUnimplementedEventsServer() {} // UnsafeEventsServer may be embedded to opt out of forward compatibility for this service. @@ -470,6 +488,24 @@ func _Events_Add_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Events_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Event) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventsServer).Remove(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Events_Remove_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventsServer).Remove(ctx, req.(*Event)) + } + return interceptor(ctx, in, info, handler) +} + // Events_ServiceDesc is the grpc.ServiceDesc for Events service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -485,6 +521,10 @@ var Events_ServiceDesc = grpc.ServiceDesc{ MethodName: "Add", Handler: _Events_Add_Handler, }, + { + MethodName: "Remove", + Handler: _Events_Remove_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "mi.proto", |
