example

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 14 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"
	Messaging_StreamRequest_FullMethodName  = "/tests.example.message.v1.Messaging/StreamRequest"
	Messaging_StreamResponse_FullMethodName = "/tests.example.message.v1.Messaging/StreamResponse"
	Messaging_Stream_FullMethodName         = "/tests.example.message.v1.Messaging/Stream"
)

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{
		{
			StreamName:    "StreamRequest",
			Handler:       _Messaging_StreamRequest_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "StreamResponse",
			Handler:       _Messaging_StreamResponse_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Stream",
			Handler:       _Messaging_Stream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	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 MessagingClientRoutes added in v1.5.8

func MessagingClientRoutes(cli MessagingClient, opts ...gors.Option) []gors.Route

func MessagingServerRoutes added in v1.5.8

func MessagingServerRoutes(srv MessagingServer, opts ...gors.Option) []gors.Route

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)
	StreamRequest(ctx context.Context, opts ...grpc.CallOption) (Messaging_StreamRequestClient, error)
	StreamResponse(ctx context.Context, in *Message, opts ...grpc.CallOption) (Messaging_StreamResponseClient, error)
	Stream(ctx context.Context, opts ...grpc.CallOption) (Messaging_StreamClient, 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)
	StreamRequest(Messaging_StreamRequestServer) error
	StreamResponse(*Message, Messaging_StreamResponseServer) error
	Stream(Messaging_StreamServer) 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 Messaging_StreamClient added in v1.5.6

type Messaging_StreamClient interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type Messaging_StreamRequestClient added in v1.5.6

type Messaging_StreamRequestClient interface {
	Send(*Message) error
	CloseAndRecv() (*Message, error)
	grpc.ClientStream
}

type Messaging_StreamRequestServer added in v1.5.6

type Messaging_StreamRequestServer interface {
	SendAndClose(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type Messaging_StreamResponseClient added in v1.5.6

type Messaging_StreamResponseClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type Messaging_StreamResponseServer added in v1.5.6

type Messaging_StreamResponseServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type Messaging_StreamServer added in v1.5.6

type Messaging_StreamServer interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

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) Stream added in v1.5.6

func (UnimplementedMessagingServer) StreamRequest added in v1.5.6

func (UnimplementedMessagingServer) StreamResponse added in v1.5.6

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