example

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Messaging_GetMessages_FullMethodName   = "/tests.example.message.v1.Messaging/GetMessages"
	Messaging_GetMessage_FullMethodName    = "/tests.example.message.v1.Messaging/GetMessage"
	Messaging_CreateMessage_FullMethodName = "/tests.example.message.v1.Messaging/CreateMessage"
	Messaging_UpdateMessage_FullMethodName = "/tests.example.message.v1.Messaging/UpdateMessage"
)

Variables

View Source
var File_example_api_tests_example_message_proto protoreflect.FileDescriptor
View Source
var Messaging_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tests.example.message.v1.Messaging",
	HandlerType: (*MessagingServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMessages",
			Handler:    _Messaging_GetMessages_Handler,
		},
		{
			MethodName: "GetMessage",
			Handler:    _Messaging_GetMessage_Handler,
		},
		{
			MethodName: "CreateMessage",
			Handler:    _Messaging_CreateMessage_Handler,
		},
		{
			MethodName: "UpdateMessage",
			Handler:    _Messaging_UpdateMessage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example/api/tests/example/message.proto",
}

Messaging_ServiceDesc is the grpc.ServiceDesc for Messaging service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func MessagingServiceRoutes

func MessagingServiceRoutes(svc MessagingService, opts ...gors.Option) []gors.Route

func RegisterMessagingServer

func RegisterMessagingServer(s grpc.ServiceRegistrar, srv MessagingServer)

Types

type GetMessageRequest

type GetMessageRequest struct {
	MessageId string   `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	UserId    uint64   `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Tags      []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMessageRequest) Descriptor deprecated

func (*GetMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMessageRequest.ProtoReflect.Descriptor instead.

func (*GetMessageRequest) GetMessageId

func (x *GetMessageRequest) GetMessageId() string

func (*GetMessageRequest) GetTags

func (x *GetMessageRequest) GetTags() []string

func (*GetMessageRequest) GetUserId

func (x *GetMessageRequest) GetUserId() uint64

func (*GetMessageRequest) ProtoMessage

func (*GetMessageRequest) ProtoMessage()

func (*GetMessageRequest) ProtoReflect

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

func (*GetMessageRequest) Reset

func (x *GetMessageRequest) Reset()

func (*GetMessageRequest) String

func (x *GetMessageRequest) String() string

type Message

type Message struct {

	// 消息id
	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// 用户id
	UserId     uint64                 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Content    string                 `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	Maybe      *string                `protobuf:"bytes,4,opt,name=maybe,proto3,oneof" json:"maybe,omitempty"`
	Tags       []string               `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"`
	UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,6,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetContent

func (x *Message) GetContent() string

func (*Message) GetMaybe

func (x *Message) GetMaybe() string

func (*Message) GetMessageId

func (x *Message) GetMessageId() string

func (*Message) GetTags

func (x *Message) GetTags() []string

func (*Message) GetUpdateMask added in v1.5.1

func (x *Message) GetUpdateMask() *fieldmaskpb.FieldMask

func (*Message) GetUserId

func (x *Message) GetUserId() uint64

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessagingClient

type MessagingClient interface {
	GetMessages(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error)
	GetMessage(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error)
	CreateMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
	UpdateMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}

MessagingClient is the client API for Messaging 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 NewMessagingClient

func NewMessagingClient(cc grpc.ClientConnInterface) MessagingClient

type MessagingServer

type MessagingServer interface {
	GetMessages(context.Context, *GetMessageRequest) (*Message, error)
	GetMessage(context.Context, *GetMessageRequest) (*Message, error)
	CreateMessage(context.Context, *Message) (*Message, error)
	UpdateMessage(context.Context, *Message) (*Message, error)
	// contains filtered or unexported methods
}

MessagingServer is the server API for Messaging service. All implementations must embed UnimplementedMessagingServer for forward compatibility

type MessagingService

type MessagingService interface {
	GetMessages(context.Context, *GetMessageRequest) (*Message, error)
	GetMessage(context.Context, *GetMessageRequest) (*Message, error)
	CreateMessage(context.Context, *Message) (*Message, error)
	UpdateMessage(context.Context, *Message) (*Message, error)
}

MessagingService is the service API for Messaging service.

type UnimplementedMessagingServer

type UnimplementedMessagingServer struct {
}

UnimplementedMessagingServer must be embedded to have forward compatible implementations.

func (UnimplementedMessagingServer) CreateMessage

func (UnimplementedMessagingServer) GetMessage

func (UnimplementedMessagingServer) GetMessages

func (UnimplementedMessagingServer) UpdateMessage

type UnsafeMessagingServer

type UnsafeMessagingServer interface {
	// contains filtered or unexported methods
}

UnsafeMessagingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessagingServer will result in compilation errors.

Jump to

Keyboard shortcuts

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