Documentation ¶
Overview ¶
Package event is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterEventServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEventServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventServiceClient) error
- func RegisterEventServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEventServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventServiceServer) error
- func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
- type AddEventRequest
- func (*AddEventRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddEventRequest) GetAuthorID() int32
- func (x *AddEventRequest) GetContent() string
- func (x *AddEventRequest) GetTitle() string
- func (*AddEventRequest) ProtoMessage()
- func (x *AddEventRequest) ProtoReflect() protoreflect.Message
- func (x *AddEventRequest) Reset()
- func (x *AddEventRequest) String() string
- type DeleteEventRequest
- func (*DeleteEventRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteEventRequest) GetAuthorId() int64
- func (x *DeleteEventRequest) GetEventId() int64
- func (*DeleteEventRequest) ProtoMessage()
- func (x *DeleteEventRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteEventRequest) Reset()
- func (x *DeleteEventRequest) String() string
- type EventDTO
- func (*EventDTO) Descriptor() ([]byte, []int)deprecated
- func (x *EventDTO) GetAuthorID() int32
- func (x *EventDTO) GetContent() string
- func (x *EventDTO) GetCreatedAt() *timestamp.Timestamp
- func (x *EventDTO) GetID() int64
- func (x *EventDTO) GetTitle() string
- func (x *EventDTO) GetUpdatedAt() *timestamp.Timestamp
- func (*EventDTO) ProtoMessage()
- func (x *EventDTO) ProtoReflect() protoreflect.Message
- func (x *EventDTO) Reset()
- func (x *EventDTO) String() string
- type EventServiceClient
- type EventServiceServer
- type EventService_ListEventsClient
- type EventService_ListEventsServer
- type GetEventRequest
- type ListEventsRequest
- type UnimplementedEventServiceServer
- func (UnimplementedEventServiceServer) AddEvent(context.Context, *AddEventRequest) (*EventDTO, error)
- func (UnimplementedEventServiceServer) DeleteEvent(context.Context, *DeleteEventRequest) (*DeleteEventRequest, error)
- func (UnimplementedEventServiceServer) GetEvent(context.Context, *GetEventRequest) (*EventDTO, error)
- func (UnimplementedEventServiceServer) ListEvents(*ListEventsRequest, EventService_ListEventsServer) error
- func (UnimplementedEventServiceServer) UpdateEvent(context.Context, *UpdateEventRequest) (*EventDTO, error)
- type UnsafeEventServiceServer
- type UpdateEventRequest
- func (*UpdateEventRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateEventRequest) GetAuthorID() int32
- func (x *UpdateEventRequest) GetContent() string
- func (x *UpdateEventRequest) GetID() int64
- func (x *UpdateEventRequest) GetTitle() string
- func (*UpdateEventRequest) ProtoMessage()
- func (x *UpdateEventRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateEventRequest) Reset()
- func (x *UpdateEventRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var File_event_event_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventServiceHandler ¶
func RegisterEventServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEventServiceHandler registers the http handlers for service EventService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEventServiceHandlerClient ¶
func RegisterEventServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventServiceClient) error
RegisterEventServiceHandlerClient registers the http handlers for service EventService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EventServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EventServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EventServiceClient" to call the correct interceptors.
func RegisterEventServiceHandlerFromEndpoint ¶
func RegisterEventServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEventServiceHandlerFromEndpoint is same as RegisterEventServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEventServiceHandlerServer ¶
func RegisterEventServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventServiceServer) error
RegisterEventServiceHandlerServer registers the http handlers for service EventService to "mux". UnaryRPC :call EventServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEventServiceHandlerFromEndpoint instead.
func RegisterEventServiceServer ¶
func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
Types ¶
type AddEventRequest ¶
type AddEventRequest struct { Title string `protobuf:"bytes,2,opt,name=Title,proto3" json:"Title,omitempty"` Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` AuthorID int32 `protobuf:"varint,4,opt,name=AuthorID,proto3" json:"AuthorID,omitempty"` // contains filtered or unexported fields }
func (*AddEventRequest) Descriptor
deprecated
func (*AddEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddEventRequest.ProtoReflect.Descriptor instead.
func (*AddEventRequest) GetAuthorID ¶
func (x *AddEventRequest) GetAuthorID() int32
func (*AddEventRequest) GetContent ¶
func (x *AddEventRequest) GetContent() string
func (*AddEventRequest) GetTitle ¶
func (x *AddEventRequest) GetTitle() string
func (*AddEventRequest) ProtoMessage ¶
func (*AddEventRequest) ProtoMessage()
func (*AddEventRequest) ProtoReflect ¶
func (x *AddEventRequest) ProtoReflect() protoreflect.Message
func (*AddEventRequest) Reset ¶
func (x *AddEventRequest) Reset()
func (*AddEventRequest) String ¶
func (x *AddEventRequest) String() string
type DeleteEventRequest ¶
type DeleteEventRequest struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` AuthorId int64 `protobuf:"varint,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteEventRequest) Descriptor
deprecated
func (*DeleteEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteEventRequest.ProtoReflect.Descriptor instead.
func (*DeleteEventRequest) GetAuthorId ¶
func (x *DeleteEventRequest) GetAuthorId() int64
func (*DeleteEventRequest) GetEventId ¶
func (x *DeleteEventRequest) GetEventId() int64
func (*DeleteEventRequest) ProtoMessage ¶
func (*DeleteEventRequest) ProtoMessage()
func (*DeleteEventRequest) ProtoReflect ¶
func (x *DeleteEventRequest) ProtoReflect() protoreflect.Message
func (*DeleteEventRequest) Reset ¶
func (x *DeleteEventRequest) Reset()
func (*DeleteEventRequest) String ¶
func (x *DeleteEventRequest) String() string
type EventDTO ¶
type EventDTO struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Title string `protobuf:"bytes,2,opt,name=Title,proto3" json:"Title,omitempty"` Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` AuthorID int32 `protobuf:"varint,4,opt,name=AuthorID,proto3" json:"AuthorID,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` // contains filtered or unexported fields }
func (*EventDTO) Descriptor
deprecated
func (*EventDTO) GetAuthorID ¶
func (*EventDTO) GetContent ¶
func (*EventDTO) GetCreatedAt ¶
func (*EventDTO) GetUpdatedAt ¶
func (*EventDTO) ProtoMessage ¶
func (*EventDTO) ProtoMessage()
func (*EventDTO) ProtoReflect ¶
func (x *EventDTO) ProtoReflect() protoreflect.Message
type EventServiceClient ¶
type EventServiceClient interface { GetEvent(ctx context.Context, in *GetEventRequest, opts ...grpc.CallOption) (*EventDTO, error) AddEvent(ctx context.Context, in *AddEventRequest, opts ...grpc.CallOption) (*EventDTO, error) UpdateEvent(ctx context.Context, in *UpdateEventRequest, opts ...grpc.CallOption) (*EventDTO, error) DeleteEvent(ctx context.Context, in *DeleteEventRequest, opts ...grpc.CallOption) (*DeleteEventRequest, error) ListEvents(ctx context.Context, in *ListEventsRequest, opts ...grpc.CallOption) (EventService_ListEventsClient, error) }
EventServiceClient is the client API for EventService 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.
func NewEventServiceClient ¶
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient
type EventServiceServer ¶
type EventServiceServer interface { GetEvent(context.Context, *GetEventRequest) (*EventDTO, error) AddEvent(context.Context, *AddEventRequest) (*EventDTO, error) UpdateEvent(context.Context, *UpdateEventRequest) (*EventDTO, error) DeleteEvent(context.Context, *DeleteEventRequest) (*DeleteEventRequest, error) ListEvents(*ListEventsRequest, EventService_ListEventsServer) error }
EventServiceServer is the server API for EventService service. All implementations should embed UnimplementedEventServiceServer for forward compatibility
type EventService_ListEventsClient ¶
type EventService_ListEventsClient interface { Recv() (*EventDTO, error) grpc.ClientStream }
type EventService_ListEventsServer ¶
type EventService_ListEventsServer interface { Send(*EventDTO) error grpc.ServerStream }
type GetEventRequest ¶
type GetEventRequest struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` // contains filtered or unexported fields }
func (*GetEventRequest) Descriptor
deprecated
func (*GetEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetEventRequest.ProtoReflect.Descriptor instead.
func (*GetEventRequest) GetEventId ¶
func (x *GetEventRequest) GetEventId() int64
func (*GetEventRequest) ProtoMessage ¶
func (*GetEventRequest) ProtoMessage()
func (*GetEventRequest) ProtoReflect ¶
func (x *GetEventRequest) ProtoReflect() protoreflect.Message
func (*GetEventRequest) Reset ¶
func (x *GetEventRequest) Reset()
func (*GetEventRequest) String ¶
func (x *GetEventRequest) String() string
type ListEventsRequest ¶
type ListEventsRequest struct {
// contains filtered or unexported fields
}
func (*ListEventsRequest) Descriptor
deprecated
func (*ListEventsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListEventsRequest.ProtoReflect.Descriptor instead.
func (*ListEventsRequest) ProtoMessage ¶
func (*ListEventsRequest) ProtoMessage()
func (*ListEventsRequest) ProtoReflect ¶
func (x *ListEventsRequest) ProtoReflect() protoreflect.Message
func (*ListEventsRequest) Reset ¶
func (x *ListEventsRequest) Reset()
func (*ListEventsRequest) String ¶
func (x *ListEventsRequest) String() string
type UnimplementedEventServiceServer ¶
type UnimplementedEventServiceServer struct { }
UnimplementedEventServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedEventServiceServer) AddEvent ¶
func (UnimplementedEventServiceServer) AddEvent(context.Context, *AddEventRequest) (*EventDTO, error)
func (UnimplementedEventServiceServer) DeleteEvent ¶
func (UnimplementedEventServiceServer) DeleteEvent(context.Context, *DeleteEventRequest) (*DeleteEventRequest, error)
func (UnimplementedEventServiceServer) GetEvent ¶
func (UnimplementedEventServiceServer) GetEvent(context.Context, *GetEventRequest) (*EventDTO, error)
func (UnimplementedEventServiceServer) ListEvents ¶
func (UnimplementedEventServiceServer) ListEvents(*ListEventsRequest, EventService_ListEventsServer) error
func (UnimplementedEventServiceServer) UpdateEvent ¶
func (UnimplementedEventServiceServer) UpdateEvent(context.Context, *UpdateEventRequest) (*EventDTO, error)
type UnsafeEventServiceServer ¶
type UnsafeEventServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventServiceServer will result in compilation errors.
type UpdateEventRequest ¶
type UpdateEventRequest struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Title string `protobuf:"bytes,2,opt,name=Title,proto3" json:"Title,omitempty"` Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` AuthorID int32 `protobuf:"varint,4,opt,name=AuthorID,proto3" json:"AuthorID,omitempty"` // contains filtered or unexported fields }
func (*UpdateEventRequest) Descriptor
deprecated
func (*UpdateEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateEventRequest.ProtoReflect.Descriptor instead.
func (*UpdateEventRequest) GetAuthorID ¶
func (x *UpdateEventRequest) GetAuthorID() int32
func (*UpdateEventRequest) GetContent ¶
func (x *UpdateEventRequest) GetContent() string
func (*UpdateEventRequest) GetID ¶
func (x *UpdateEventRequest) GetID() int64
func (*UpdateEventRequest) GetTitle ¶
func (x *UpdateEventRequest) GetTitle() string
func (*UpdateEventRequest) ProtoMessage ¶
func (*UpdateEventRequest) ProtoMessage()
func (*UpdateEventRequest) ProtoReflect ¶
func (x *UpdateEventRequest) ProtoReflect() protoreflect.Message
func (*UpdateEventRequest) Reset ¶
func (x *UpdateEventRequest) Reset()
func (*UpdateEventRequest) String ¶
func (x *UpdateEventRequest) String() string