Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMessageHTTPServer(s *http.Server, srv MessageHTTPServer)
- func RegisterMessageServer(s grpc.ServiceRegistrar, srv MessageServer)
- type MessageClient
- type MessageHTTPClient
- type MessageHTTPClientImpl
- func (c *MessageHTTPClientImpl) CreateRoomEvent(ctx context.Context, in *RoomEvent, opts ...http.CallOption) (*api.Success, error)
- func (c *MessageHTTPClientImpl) CreateUserEvent(ctx context.Context, in *UserEvent, opts ...http.CallOption) (*api.Success, error)
- func (c *MessageHTTPClientImpl) GetAlismsCode(ctx context.Context, in *Phone, opts ...http.CallOption) (*api.Success, error)
- func (c *MessageHTTPClientImpl) PostAlismsCode(ctx context.Context, in *SMSCode, opts ...http.CallOption) (*api.Success, error)
- type MessageHTTPServer
- type MessageServer
- type Phone
- type PhoneMultiError
- type PhoneValidationError
- type RoomEvent
- func (*RoomEvent) Descriptor() ([]byte, []int)deprecated
- func (x *RoomEvent) GetEventType() string
- func (x *RoomEvent) GetMessage() string
- func (x *RoomEvent) GetRequestID() string
- func (x *RoomEvent) GetRoom() string
- func (*RoomEvent) ProtoMessage()
- func (x *RoomEvent) ProtoReflect() protoreflect.Message
- func (x *RoomEvent) Reset()
- func (x *RoomEvent) String() string
- func (m *RoomEvent) Validate() error
- func (m *RoomEvent) ValidateAll() error
- type RoomEventMultiError
- type RoomEventValidationError
- type SMSCode
- func (*SMSCode) Descriptor() ([]byte, []int)deprecated
- func (x *SMSCode) GetCode() string
- func (x *SMSCode) GetPhone() string
- func (*SMSCode) ProtoMessage()
- func (x *SMSCode) ProtoReflect() protoreflect.Message
- func (x *SMSCode) Reset()
- func (x *SMSCode) String() string
- func (m *SMSCode) Validate() error
- func (m *SMSCode) ValidateAll() error
- type SMSCodeMultiError
- type SMSCodeValidationError
- type UnimplementedMessageServer
- func (UnimplementedMessageServer) CreateRoomEvent(context.Context, *RoomEvent) (*api.Success, error)
- func (UnimplementedMessageServer) CreateUserEvent(context.Context, *UserEvent) (*api.Success, error)
- func (UnimplementedMessageServer) GetAlismsCode(context.Context, *Phone) (*api.Success, error)
- func (UnimplementedMessageServer) PostAlismsCode(context.Context, *SMSCode) (*api.Success, error)
- type UnsafeMessageServer
- type UserEvent
- func (*UserEvent) Descriptor() ([]byte, []int)deprecated
- func (x *UserEvent) GetDeviceType() string
- func (x *UserEvent) GetEventType() string
- func (x *UserEvent) GetMessage() string
- func (x *UserEvent) GetRequestID() string
- func (x *UserEvent) GetUserIDList() []int64
- func (*UserEvent) ProtoMessage()
- func (x *UserEvent) ProtoReflect() protoreflect.Message
- func (x *UserEvent) Reset()
- func (x *UserEvent) String() string
- func (m *UserEvent) Validate() error
- func (m *UserEvent) ValidateAll() error
- type UserEventMultiError
- type UserEventValidationError
Constants ¶
const OperationMessageCreateRoomEvent = "/api.message.Message/CreateRoomEvent"
const OperationMessageCreateUserEvent = "/api.message.Message/CreateUserEvent"
const OperationMessageGetAlismsCode = "/api.message.Message/GetAlismsCode"
const OperationMessagePostAlismsCode = "/api.message.Message/PostAlismsCode"
Variables ¶
var File_api_message_message_proto protoreflect.FileDescriptor
var Message_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.message.Message", HandlerType: (*MessageServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAlismsCode", Handler: _Message_GetAlismsCode_Handler, }, { MethodName: "PostAlismsCode", Handler: _Message_PostAlismsCode_Handler, }, { MethodName: "CreateRoomEvent", Handler: _Message_CreateRoomEvent_Handler, }, { MethodName: "CreateUserEvent", Handler: _Message_CreateUserEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/message/message.proto", }
Message_ServiceDesc is the grpc.ServiceDesc for Message service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMessageHTTPServer ¶
func RegisterMessageHTTPServer(s *http.Server, srv MessageHTTPServer)
func RegisterMessageServer ¶
func RegisterMessageServer(s grpc.ServiceRegistrar, srv MessageServer)
Types ¶
type MessageClient ¶
type MessageClient interface { GetAlismsCode(ctx context.Context, in *Phone, opts ...grpc.CallOption) (*api.Success, error) PostAlismsCode(ctx context.Context, in *SMSCode, opts ...grpc.CallOption) (*api.Success, error) CreateRoomEvent(ctx context.Context, in *RoomEvent, opts ...grpc.CallOption) (*api.Success, error) CreateUserEvent(ctx context.Context, in *UserEvent, opts ...grpc.CallOption) (*api.Success, error) }
MessageClient is the client API for Message 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 NewMessageClient ¶
func NewMessageClient(cc grpc.ClientConnInterface) MessageClient
type MessageHTTPClient ¶
type MessageHTTPClient interface { CreateRoomEvent(ctx context.Context, req *RoomEvent, opts ...http.CallOption) (rsp *api.Success, err error) CreateUserEvent(ctx context.Context, req *UserEvent, opts ...http.CallOption) (rsp *api.Success, err error) GetAlismsCode(ctx context.Context, req *Phone, opts ...http.CallOption) (rsp *api.Success, err error) PostAlismsCode(ctx context.Context, req *SMSCode, opts ...http.CallOption) (rsp *api.Success, err error) }
func NewMessageHTTPClient ¶
func NewMessageHTTPClient(client *http.Client) MessageHTTPClient
type MessageHTTPClientImpl ¶
type MessageHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*MessageHTTPClientImpl) CreateRoomEvent ¶
func (c *MessageHTTPClientImpl) CreateRoomEvent(ctx context.Context, in *RoomEvent, opts ...http.CallOption) (*api.Success, error)
func (*MessageHTTPClientImpl) CreateUserEvent ¶
func (c *MessageHTTPClientImpl) CreateUserEvent(ctx context.Context, in *UserEvent, opts ...http.CallOption) (*api.Success, error)
func (*MessageHTTPClientImpl) GetAlismsCode ¶
func (c *MessageHTTPClientImpl) GetAlismsCode(ctx context.Context, in *Phone, opts ...http.CallOption) (*api.Success, error)
func (*MessageHTTPClientImpl) PostAlismsCode ¶
func (c *MessageHTTPClientImpl) PostAlismsCode(ctx context.Context, in *SMSCode, opts ...http.CallOption) (*api.Success, error)
type MessageHTTPServer ¶
type MessageServer ¶
type MessageServer interface { GetAlismsCode(context.Context, *Phone) (*api.Success, error) PostAlismsCode(context.Context, *SMSCode) (*api.Success, error) CreateRoomEvent(context.Context, *RoomEvent) (*api.Success, error) CreateUserEvent(context.Context, *UserEvent) (*api.Success, error) // contains filtered or unexported methods }
MessageServer is the server API for Message service. All implementations must embed UnimplementedMessageServer for forward compatibility
type Phone ¶
type Phone struct { Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` // contains filtered or unexported fields }
func (*Phone) Descriptor
deprecated
func (*Phone) ProtoMessage ¶
func (*Phone) ProtoMessage()
func (*Phone) ProtoReflect ¶
func (x *Phone) ProtoReflect() protoreflect.Message
func (*Phone) Validate ¶
Validate checks the field values on Phone 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 (*Phone) ValidateAll ¶
ValidateAll checks the field values on Phone 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 PhoneMultiError, or nil if none found.
type PhoneMultiError ¶
type PhoneMultiError []error
PhoneMultiError is an error wrapping multiple validation errors returned by Phone.ValidateAll() if the designated constraints aren't met.
func (PhoneMultiError) AllErrors ¶
func (m PhoneMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PhoneMultiError) Error ¶
func (m PhoneMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PhoneValidationError ¶
type PhoneValidationError struct {
// contains filtered or unexported fields
}
PhoneValidationError is the validation error returned by Phone.Validate if the designated constraints aren't met.
func (PhoneValidationError) Cause ¶
func (e PhoneValidationError) Cause() error
Cause function returns cause value.
func (PhoneValidationError) Error ¶
func (e PhoneValidationError) Error() string
Error satisfies the builtin error interface
func (PhoneValidationError) ErrorName ¶
func (e PhoneValidationError) ErrorName() string
ErrorName returns error name.
func (PhoneValidationError) Field ¶
func (e PhoneValidationError) Field() string
Field function returns field value.
func (PhoneValidationError) Key ¶
func (e PhoneValidationError) Key() bool
Key function returns key value.
func (PhoneValidationError) Reason ¶
func (e PhoneValidationError) Reason() string
Reason function returns reason value.
type RoomEvent ¶
type RoomEvent struct { EventType string `protobuf:"bytes,1,opt,name=eventType,proto3" json:"eventType,omitempty"` Room string `protobuf:"bytes,2,opt,name=room,proto3" json:"room,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` RequestID string `protobuf:"bytes,4,opt,name=requestID,proto3" json:"requestID,omitempty"` // contains filtered or unexported fields }
func (*RoomEvent) Descriptor
deprecated
func (*RoomEvent) GetEventType ¶
func (*RoomEvent) GetMessage ¶
func (*RoomEvent) GetRequestID ¶
func (*RoomEvent) ProtoMessage ¶
func (*RoomEvent) ProtoMessage()
func (*RoomEvent) ProtoReflect ¶
func (x *RoomEvent) ProtoReflect() protoreflect.Message
func (*RoomEvent) Validate ¶
Validate checks the field values on RoomEvent 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 (*RoomEvent) ValidateAll ¶
ValidateAll checks the field values on RoomEvent 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 RoomEventMultiError, or nil if none found.
type RoomEventMultiError ¶
type RoomEventMultiError []error
RoomEventMultiError is an error wrapping multiple validation errors returned by RoomEvent.ValidateAll() if the designated constraints aren't met.
func (RoomEventMultiError) AllErrors ¶
func (m RoomEventMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RoomEventMultiError) Error ¶
func (m RoomEventMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RoomEventValidationError ¶
type RoomEventValidationError struct {
// contains filtered or unexported fields
}
RoomEventValidationError is the validation error returned by RoomEvent.Validate if the designated constraints aren't met.
func (RoomEventValidationError) Cause ¶
func (e RoomEventValidationError) Cause() error
Cause function returns cause value.
func (RoomEventValidationError) Error ¶
func (e RoomEventValidationError) Error() string
Error satisfies the builtin error interface
func (RoomEventValidationError) ErrorName ¶
func (e RoomEventValidationError) ErrorName() string
ErrorName returns error name.
func (RoomEventValidationError) Field ¶
func (e RoomEventValidationError) Field() string
Field function returns field value.
func (RoomEventValidationError) Key ¶
func (e RoomEventValidationError) Key() bool
Key function returns key value.
func (RoomEventValidationError) Reason ¶
func (e RoomEventValidationError) Reason() string
Reason function returns reason value.
type SMSCode ¶
type SMSCode struct { Phone string `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*SMSCode) Descriptor
deprecated
func (*SMSCode) ProtoMessage ¶
func (*SMSCode) ProtoMessage()
func (*SMSCode) ProtoReflect ¶
func (x *SMSCode) ProtoReflect() protoreflect.Message
func (*SMSCode) Validate ¶
Validate checks the field values on SMSCode 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 (*SMSCode) ValidateAll ¶
ValidateAll checks the field values on SMSCode 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 SMSCodeMultiError, or nil if none found.
type SMSCodeMultiError ¶
type SMSCodeMultiError []error
SMSCodeMultiError is an error wrapping multiple validation errors returned by SMSCode.ValidateAll() if the designated constraints aren't met.
func (SMSCodeMultiError) AllErrors ¶
func (m SMSCodeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SMSCodeMultiError) Error ¶
func (m SMSCodeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SMSCodeValidationError ¶
type SMSCodeValidationError struct {
// contains filtered or unexported fields
}
SMSCodeValidationError is the validation error returned by SMSCode.Validate if the designated constraints aren't met.
func (SMSCodeValidationError) Cause ¶
func (e SMSCodeValidationError) Cause() error
Cause function returns cause value.
func (SMSCodeValidationError) Error ¶
func (e SMSCodeValidationError) Error() string
Error satisfies the builtin error interface
func (SMSCodeValidationError) ErrorName ¶
func (e SMSCodeValidationError) ErrorName() string
ErrorName returns error name.
func (SMSCodeValidationError) Field ¶
func (e SMSCodeValidationError) Field() string
Field function returns field value.
func (SMSCodeValidationError) Key ¶
func (e SMSCodeValidationError) Key() bool
Key function returns key value.
func (SMSCodeValidationError) Reason ¶
func (e SMSCodeValidationError) Reason() string
Reason function returns reason value.
type UnimplementedMessageServer ¶
type UnimplementedMessageServer struct { }
UnimplementedMessageServer must be embedded to have forward compatible implementations.
func (UnimplementedMessageServer) CreateRoomEvent ¶
func (UnimplementedMessageServer) CreateUserEvent ¶
func (UnimplementedMessageServer) GetAlismsCode ¶
func (UnimplementedMessageServer) PostAlismsCode ¶
type UnsafeMessageServer ¶
type UnsafeMessageServer interface {
// contains filtered or unexported methods
}
UnsafeMessageServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessageServer will result in compilation errors.
type UserEvent ¶
type UserEvent struct { EventType string `protobuf:"bytes,1,opt,name=eventType,proto3" json:"eventType,omitempty"` UserIDList []int64 `protobuf:"varint,2,rep,packed,name=userIDList,proto3" json:"userIDList,omitempty"` // deviceType 只能为 DeviceType string `protobuf:"bytes,3,opt,name=deviceType,proto3" json:"deviceType,omitempty"` Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` RequestID string `protobuf:"bytes,5,opt,name=requestID,proto3" json:"requestID,omitempty"` // contains filtered or unexported fields }
func (*UserEvent) Descriptor
deprecated
func (*UserEvent) GetDeviceType ¶
func (*UserEvent) GetEventType ¶
func (*UserEvent) GetMessage ¶
func (*UserEvent) GetRequestID ¶
func (*UserEvent) GetUserIDList ¶
func (*UserEvent) ProtoMessage ¶
func (*UserEvent) ProtoMessage()
func (*UserEvent) ProtoReflect ¶
func (x *UserEvent) ProtoReflect() protoreflect.Message
func (*UserEvent) Validate ¶
Validate checks the field values on UserEvent 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 (*UserEvent) ValidateAll ¶
ValidateAll checks the field values on UserEvent 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 UserEventMultiError, or nil if none found.
type UserEventMultiError ¶
type UserEventMultiError []error
UserEventMultiError is an error wrapping multiple validation errors returned by UserEvent.ValidateAll() if the designated constraints aren't met.
func (UserEventMultiError) AllErrors ¶
func (m UserEventMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserEventMultiError) Error ¶
func (m UserEventMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserEventValidationError ¶
type UserEventValidationError struct {
// contains filtered or unexported fields
}
UserEventValidationError is the validation error returned by UserEvent.Validate if the designated constraints aren't met.
func (UserEventValidationError) Cause ¶
func (e UserEventValidationError) Cause() error
Cause function returns cause value.
func (UserEventValidationError) Error ¶
func (e UserEventValidationError) Error() string
Error satisfies the builtin error interface
func (UserEventValidationError) ErrorName ¶
func (e UserEventValidationError) ErrorName() string
ErrorName returns error name.
func (UserEventValidationError) Field ¶
func (e UserEventValidationError) Field() string
Field function returns field value.
func (UserEventValidationError) Key ¶
func (e UserEventValidationError) Key() bool
Key function returns key value.
func (UserEventValidationError) Reason ¶
func (e UserEventValidationError) Reason() string
Reason function returns reason value.