contracts

package
v0.0.0-...-1df178c Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_messenger_proto protoreflect.FileDescriptor
View Source
var Messenger_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "contracts.Messenger",
	HandlerType: (*MessengerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListMessages",
			Handler:    _Messenger_ListMessages_Handler,
		},
		{
			MethodName: "AddMessage",
			Handler:    _Messenger_AddMessage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "messenger.proto",
}

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

Functions

func RegisterMessengerServer

func RegisterMessengerServer(s grpc.ServiceRegistrar, srv MessengerServer)

Types

type ListMessageResponse

type ListMessageResponse struct {
	Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*ListMessageResponse) Descriptor deprecated

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

Deprecated: Use ListMessageResponse.ProtoReflect.Descriptor instead.

func (*ListMessageResponse) GetMessages

func (x *ListMessageResponse) GetMessages() []*Message

func (*ListMessageResponse) ProtoMessage

func (*ListMessageResponse) ProtoMessage()

func (*ListMessageResponse) ProtoReflect

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

func (*ListMessageResponse) Reset

func (x *ListMessageResponse) Reset()

func (*ListMessageResponse) String

func (x *ListMessageResponse) String() string

type Message

type Message struct {
	Body string                 `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	Ts   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ts,proto3" json:"ts,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() string

func (*Message) GetTs

func (x *Message) GetTs() *timestamppb.Timestamp

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 MessengerClient

type MessengerClient interface {
	ListMessages(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListMessageResponse, error)
	AddMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}

MessengerClient is the client API for Messenger 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 NewMessengerClient

func NewMessengerClient(cc grpc.ClientConnInterface) MessengerClient

type MessengerServer

type MessengerServer interface {
	ListMessages(context.Context, *emptypb.Empty) (*ListMessageResponse, error)
	AddMessage(context.Context, *Message) (*Message, error)
	// contains filtered or unexported methods
}

MessengerServer is the server API for Messenger service. All implementations must embed UnimplementedMessengerServer for forward compatibility

type UnimplementedMessengerServer

type UnimplementedMessengerServer struct {
}

UnimplementedMessengerServer must be embedded to have forward compatible implementations.

func (UnimplementedMessengerServer) AddMessage

func (UnimplementedMessengerServer) ListMessages

type UnsafeMessengerServer

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

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

Jump to

Keyboard shortcuts

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