message

package
v0.0.0-...-c38fcd0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const OperationMessageCreateRoomEvent = "/api.message.Message/CreateRoomEvent"
View Source
const OperationMessageCreateUserEvent = "/api.message.Message/CreateUserEvent"
View Source
const OperationMessageGetAlismsCode = "/api.message.Message/GetAlismsCode"
View Source
const OperationMessagePostAlismsCode = "/api.message.Message/PostAlismsCode"

Variables

View Source
var File_api_message_message_proto protoreflect.FileDescriptor
View Source
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 MessageHTTPServer interface {
	CreateRoomEvent(context.Context, *RoomEvent) (*api.Success, error)
	CreateUserEvent(context.Context, *UserEvent) (*api.Success, error)
	GetAlismsCode(context.Context, *Phone) (*api.Success, error)
	PostAlismsCode(context.Context, *SMSCode) (*api.Success, error)
}

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) Descriptor() ([]byte, []int)

Deprecated: Use Phone.ProtoReflect.Descriptor instead.

func (*Phone) GetPhone

func (x *Phone) GetPhone() string

func (*Phone) ProtoMessage

func (*Phone) ProtoMessage()

func (*Phone) ProtoReflect

func (x *Phone) ProtoReflect() protoreflect.Message

func (*Phone) Reset

func (x *Phone) Reset()

func (*Phone) String

func (x *Phone) String() string

func (*Phone) Validate

func (m *Phone) Validate() error

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

func (m *Phone) ValidateAll() error

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) Descriptor() ([]byte, []int)

Deprecated: Use RoomEvent.ProtoReflect.Descriptor instead.

func (*RoomEvent) GetEventType

func (x *RoomEvent) GetEventType() string

func (*RoomEvent) GetMessage

func (x *RoomEvent) GetMessage() string

func (*RoomEvent) GetRequestID

func (x *RoomEvent) GetRequestID() string

func (*RoomEvent) GetRoom

func (x *RoomEvent) GetRoom() string

func (*RoomEvent) ProtoMessage

func (*RoomEvent) ProtoMessage()

func (*RoomEvent) ProtoReflect

func (x *RoomEvent) ProtoReflect() protoreflect.Message

func (*RoomEvent) Reset

func (x *RoomEvent) Reset()

func (*RoomEvent) String

func (x *RoomEvent) String() string

func (*RoomEvent) Validate

func (m *RoomEvent) Validate() error

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

func (m *RoomEvent) ValidateAll() error

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

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) Descriptor() ([]byte, []int)

Deprecated: Use SMSCode.ProtoReflect.Descriptor instead.

func (*SMSCode) GetCode

func (x *SMSCode) GetCode() string

func (*SMSCode) GetPhone

func (x *SMSCode) GetPhone() string

func (*SMSCode) ProtoMessage

func (*SMSCode) ProtoMessage()

func (*SMSCode) ProtoReflect

func (x *SMSCode) ProtoReflect() protoreflect.Message

func (*SMSCode) Reset

func (x *SMSCode) Reset()

func (*SMSCode) String

func (x *SMSCode) String() string

func (*SMSCode) Validate

func (m *SMSCode) Validate() error

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

func (m *SMSCode) ValidateAll() error

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) Descriptor() ([]byte, []int)

Deprecated: Use UserEvent.ProtoReflect.Descriptor instead.

func (*UserEvent) GetDeviceType

func (x *UserEvent) GetDeviceType() string

func (*UserEvent) GetEventType

func (x *UserEvent) GetEventType() string

func (*UserEvent) GetMessage

func (x *UserEvent) GetMessage() string

func (*UserEvent) GetRequestID

func (x *UserEvent) GetRequestID() string

func (*UserEvent) GetUserIDList

func (x *UserEvent) GetUserIDList() []int64

func (*UserEvent) ProtoMessage

func (*UserEvent) ProtoMessage()

func (*UserEvent) ProtoReflect

func (x *UserEvent) ProtoReflect() protoreflect.Message

func (*UserEvent) Reset

func (x *UserEvent) Reset()

func (*UserEvent) String

func (x *UserEvent) String() string

func (*UserEvent) Validate

func (m *UserEvent) Validate() error

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

func (m *UserEvent) ValidateAll() error

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

Key function returns key value.

func (UserEventValidationError) Reason

func (e UserEventValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL