Documentation ¶
Overview ¶
Package event is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterEventHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEventHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventClient) error
- func RegisterEventHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEventHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventServer) error
- func RegisterEventServer(s grpc.ServiceRegistrar, srv EventServer)
- type EventClient
- type EventServer
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetActionType() types.EventActionType
- func (x *ListRequest) GetPage() int32
- func (x *ListRequest) GetPageSize() int32
- func (x *ListRequest) GetSearch() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- func (m *ListRequest) Validate() error
- func (m *ListRequest) ValidateAll() error
- type ListRequestMultiError
- type ListRequestValidationError
- func (e ListRequestValidationError) Cause() error
- func (e ListRequestValidationError) Error() string
- func (e ListRequestValidationError) ErrorName() string
- func (e ListRequestValidationError) Field() string
- func (e ListRequestValidationError) Key() bool
- func (e ListRequestValidationError) Reason() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetItems() []*types.EventModel
- func (x *ListResponse) GetPage() int32
- func (x *ListResponse) GetPageSize() int32
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- func (m *ListResponse) Validate() error
- func (m *ListResponse) ValidateAll() error
- type ListResponseMultiError
- type ListResponseValidationError
- func (e ListResponseValidationError) Cause() error
- func (e ListResponseValidationError) Error() string
- func (e ListResponseValidationError) ErrorName() string
- func (e ListResponseValidationError) Field() string
- func (e ListResponseValidationError) Key() bool
- func (e ListResponseValidationError) Reason() string
- type ShowRequest
- func (*ShowRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ShowRequest) GetId() int32
- func (*ShowRequest) ProtoMessage()
- func (x *ShowRequest) ProtoReflect() protoreflect.Message
- func (x *ShowRequest) Reset()
- func (x *ShowRequest) String() string
- func (m *ShowRequest) Validate() error
- func (m *ShowRequest) ValidateAll() error
- type ShowRequestMultiError
- type ShowRequestValidationError
- func (e ShowRequestValidationError) Cause() error
- func (e ShowRequestValidationError) Error() string
- func (e ShowRequestValidationError) ErrorName() string
- func (e ShowRequestValidationError) Field() string
- func (e ShowRequestValidationError) Key() bool
- func (e ShowRequestValidationError) Reason() string
- type ShowResponse
- func (*ShowResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ShowResponse) GetItem() *types.EventModel
- func (*ShowResponse) ProtoMessage()
- func (x *ShowResponse) ProtoReflect() protoreflect.Message
- func (x *ShowResponse) Reset()
- func (x *ShowResponse) String() string
- func (m *ShowResponse) Validate() error
- func (m *ShowResponse) ValidateAll() error
- type ShowResponseMultiError
- type ShowResponseValidationError
- func (e ShowResponseValidationError) Cause() error
- func (e ShowResponseValidationError) Error() string
- func (e ShowResponseValidationError) ErrorName() string
- func (e ShowResponseValidationError) Field() string
- func (e ShowResponseValidationError) Key() bool
- func (e ShowResponseValidationError) Reason() string
- type UnimplementedEventServer
- type UnsafeEventServer
Constants ¶
const ( Event_List_FullMethodName = "/event.Event/List" Event_Show_FullMethodName = "/event.Event/Show" )
Variables ¶
var Event_ServiceDesc = grpc.ServiceDesc{ ServiceName: "event.Event", HandlerType: (*EventServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _Event_List_Handler, }, { MethodName: "Show", Handler: _Event_Show_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "event/event.proto", }
Event_ServiceDesc is the grpc.ServiceDesc for Event service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_event_event_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventHandler ¶
RegisterEventHandler registers the http handlers for service Event to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEventHandlerClient ¶
func RegisterEventHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventClient) error
RegisterEventHandlerClient registers the http handlers for service Event to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EventClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EventClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EventClient" to call the correct interceptors.
func RegisterEventHandlerFromEndpoint ¶
func RegisterEventHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEventHandlerFromEndpoint is same as RegisterEventHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEventHandlerServer ¶
func RegisterEventHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventServer) error
RegisterEventHandlerServer registers the http handlers for service Event to "mux". UnaryRPC :call EventServer 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 RegisterEventHandlerFromEndpoint instead.
func RegisterEventServer ¶
func RegisterEventServer(s grpc.ServiceRegistrar, srv EventServer)
Types ¶
type EventClient ¶
type EventClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Show(ctx context.Context, in *ShowRequest, opts ...grpc.CallOption) (*ShowResponse, error) }
EventClient is the client API for Event 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 NewEventClient ¶
func NewEventClient(cc grpc.ClientConnInterface) EventClient
type EventServer ¶
type EventServer interface { List(context.Context, *ListRequest) (*ListResponse, error) Show(context.Context, *ShowRequest) (*ShowResponse, error) // contains filtered or unexported methods }
EventServer is the server API for Event service. All implementations must embed UnimplementedEventServer for forward compatibility
type ListRequest ¶
type ListRequest struct { Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"` PageSize *int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3,oneof" json:"page_size,omitempty"` ActionType types.EventActionType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=types.EventActionType" json:"action_type,omitempty"` // 模糊搜索 message 和 username Search string `protobuf:"bytes,4,opt,name=search,proto3" json:"search,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetActionType ¶
func (x *ListRequest) GetActionType() types.EventActionType
func (*ListRequest) GetPage ¶
func (x *ListRequest) GetPage() int32
func (*ListRequest) GetPageSize ¶
func (x *ListRequest) GetPageSize() int32
func (*ListRequest) GetSearch ¶
func (x *ListRequest) GetSearch() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
func (*ListRequest) Validate ¶
func (m *ListRequest) Validate() error
Validate checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ListRequest) ValidateAll ¶
func (m *ListRequest) ValidateAll() error
ValidateAll checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListRequestMultiError, or nil if none found.
type ListRequestMultiError ¶
type ListRequestMultiError []error
ListRequestMultiError is an error wrapping multiple validation errors returned by ListRequest.ValidateAll() if the designated constraints aren't met.
func (ListRequestMultiError) AllErrors ¶
func (m ListRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListRequestMultiError) Error ¶
func (m ListRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListRequestValidationError ¶
type ListRequestValidationError struct {
// contains filtered or unexported fields
}
ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.
func (ListRequestValidationError) Cause ¶
func (e ListRequestValidationError) Cause() error
Cause function returns cause value.
func (ListRequestValidationError) Error ¶
func (e ListRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ListRequestValidationError) ErrorName ¶
func (e ListRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ListRequestValidationError) Field ¶
func (e ListRequestValidationError) Field() string
Field function returns field value.
func (ListRequestValidationError) Key ¶
func (e ListRequestValidationError) Key() bool
Key function returns key value.
func (ListRequestValidationError) Reason ¶
func (e ListRequestValidationError) Reason() string
Reason function returns reason value.
type ListResponse ¶
type ListResponse struct { Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` Items []*types.EventModel `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetItems ¶
func (x *ListResponse) GetItems() []*types.EventModel
func (*ListResponse) GetPage ¶
func (x *ListResponse) GetPage() int32
func (*ListResponse) GetPageSize ¶
func (x *ListResponse) GetPageSize() int32
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
func (*ListResponse) Validate ¶
func (m *ListResponse) Validate() error
Validate checks the field values on ListResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ListResponse) ValidateAll ¶
func (m *ListResponse) ValidateAll() error
ValidateAll checks the field values on ListResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListResponseMultiError, or nil if none found.
type ListResponseMultiError ¶
type ListResponseMultiError []error
ListResponseMultiError is an error wrapping multiple validation errors returned by ListResponse.ValidateAll() if the designated constraints aren't met.
func (ListResponseMultiError) AllErrors ¶
func (m ListResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListResponseMultiError) Error ¶
func (m ListResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListResponseValidationError ¶
type ListResponseValidationError struct {
// contains filtered or unexported fields
}
ListResponseValidationError is the validation error returned by ListResponse.Validate if the designated constraints aren't met.
func (ListResponseValidationError) Cause ¶
func (e ListResponseValidationError) Cause() error
Cause function returns cause value.
func (ListResponseValidationError) Error ¶
func (e ListResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ListResponseValidationError) ErrorName ¶
func (e ListResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ListResponseValidationError) Field ¶
func (e ListResponseValidationError) Field() string
Field function returns field value.
func (ListResponseValidationError) Key ¶
func (e ListResponseValidationError) Key() bool
Key function returns key value.
func (ListResponseValidationError) Reason ¶
func (e ListResponseValidationError) Reason() string
Reason function returns reason value.
type ShowRequest ¶
type ShowRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ShowRequest) Descriptor
deprecated
func (*ShowRequest) Descriptor() ([]byte, []int)
Deprecated: Use ShowRequest.ProtoReflect.Descriptor instead.
func (*ShowRequest) GetId ¶
func (x *ShowRequest) GetId() int32
func (*ShowRequest) ProtoMessage ¶
func (*ShowRequest) ProtoMessage()
func (*ShowRequest) ProtoReflect ¶
func (x *ShowRequest) ProtoReflect() protoreflect.Message
func (*ShowRequest) Reset ¶
func (x *ShowRequest) Reset()
func (*ShowRequest) String ¶
func (x *ShowRequest) String() string
func (*ShowRequest) Validate ¶
func (m *ShowRequest) Validate() error
Validate checks the field values on ShowRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ShowRequest) ValidateAll ¶
func (m *ShowRequest) ValidateAll() error
ValidateAll checks the field values on ShowRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ShowRequestMultiError, or nil if none found.
type ShowRequestMultiError ¶
type ShowRequestMultiError []error
ShowRequestMultiError is an error wrapping multiple validation errors returned by ShowRequest.ValidateAll() if the designated constraints aren't met.
func (ShowRequestMultiError) AllErrors ¶
func (m ShowRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ShowRequestMultiError) Error ¶
func (m ShowRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ShowRequestValidationError ¶
type ShowRequestValidationError struct {
// contains filtered or unexported fields
}
ShowRequestValidationError is the validation error returned by ShowRequest.Validate if the designated constraints aren't met.
func (ShowRequestValidationError) Cause ¶
func (e ShowRequestValidationError) Cause() error
Cause function returns cause value.
func (ShowRequestValidationError) Error ¶
func (e ShowRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ShowRequestValidationError) ErrorName ¶
func (e ShowRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ShowRequestValidationError) Field ¶
func (e ShowRequestValidationError) Field() string
Field function returns field value.
func (ShowRequestValidationError) Key ¶
func (e ShowRequestValidationError) Key() bool
Key function returns key value.
func (ShowRequestValidationError) Reason ¶
func (e ShowRequestValidationError) Reason() string
Reason function returns reason value.
type ShowResponse ¶
type ShowResponse struct { Item *types.EventModel `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
func (*ShowResponse) Descriptor
deprecated
func (*ShowResponse) Descriptor() ([]byte, []int)
Deprecated: Use ShowResponse.ProtoReflect.Descriptor instead.
func (*ShowResponse) GetItem ¶
func (x *ShowResponse) GetItem() *types.EventModel
func (*ShowResponse) ProtoMessage ¶
func (*ShowResponse) ProtoMessage()
func (*ShowResponse) ProtoReflect ¶
func (x *ShowResponse) ProtoReflect() protoreflect.Message
func (*ShowResponse) Reset ¶
func (x *ShowResponse) Reset()
func (*ShowResponse) String ¶
func (x *ShowResponse) String() string
func (*ShowResponse) Validate ¶
func (m *ShowResponse) Validate() error
Validate checks the field values on ShowResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ShowResponse) ValidateAll ¶
func (m *ShowResponse) ValidateAll() error
ValidateAll checks the field values on ShowResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ShowResponseMultiError, or nil if none found.
type ShowResponseMultiError ¶
type ShowResponseMultiError []error
ShowResponseMultiError is an error wrapping multiple validation errors returned by ShowResponse.ValidateAll() if the designated constraints aren't met.
func (ShowResponseMultiError) AllErrors ¶
func (m ShowResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ShowResponseMultiError) Error ¶
func (m ShowResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ShowResponseValidationError ¶
type ShowResponseValidationError struct {
// contains filtered or unexported fields
}
ShowResponseValidationError is the validation error returned by ShowResponse.Validate if the designated constraints aren't met.
func (ShowResponseValidationError) Cause ¶
func (e ShowResponseValidationError) Cause() error
Cause function returns cause value.
func (ShowResponseValidationError) Error ¶
func (e ShowResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ShowResponseValidationError) ErrorName ¶
func (e ShowResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ShowResponseValidationError) Field ¶
func (e ShowResponseValidationError) Field() string
Field function returns field value.
func (ShowResponseValidationError) Key ¶
func (e ShowResponseValidationError) Key() bool
Key function returns key value.
func (ShowResponseValidationError) Reason ¶
func (e ShowResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedEventServer ¶
type UnimplementedEventServer struct { }
UnimplementedEventServer must be embedded to have forward compatible implementations.
func (UnimplementedEventServer) List ¶
func (UnimplementedEventServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedEventServer) Show ¶
func (UnimplementedEventServer) Show(context.Context, *ShowRequest) (*ShowResponse, error)
type UnsafeEventServer ¶
type UnsafeEventServer interface {
// contains filtered or unexported methods
}
UnsafeEventServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventServer will result in compilation errors.