proto

package
v0.0.0-...-ce3a4c7 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Template_Increment_FullMethodName = "/proto.Template/Increment"
	Template_SayHi_FullMethodName     = "/proto.Template/SayHi"
)

Variables

View Source
var File_proto_template_proto protoreflect.FileDescriptor
View Source
var Template_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Template",
	HandlerType: (*TemplateServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Increment",
			Handler:    _Template_Increment_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SayHi",
			Handler:       _Template_SayHi_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "proto/template.proto",
}

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

Functions

func RegisterTemplateServer

func RegisterTemplateServer(s grpc.ServiceRegistrar, srv TemplateServer)

Types

type Ack

type Ack struct {
	NewValue int64 `protobuf:"varint,1,opt,name=newValue,proto3" json:"newValue,omitempty"`
	// contains filtered or unexported fields
}

func (*Ack) Descriptor deprecated

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

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetNewValue

func (x *Ack) GetNewValue() int64

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

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

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type Amount

type Amount struct {
	ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"`
	Value      int64  `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Amount is a type containing a string and int. They are intialized as the first and second parameter value.

func (*Amount) Descriptor deprecated

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

Deprecated: Use Amount.ProtoReflect.Descriptor instead.

func (*Amount) GetClientName

func (x *Amount) GetClientName() string

func (*Amount) GetValue

func (x *Amount) GetValue() int64

func (*Amount) ProtoMessage

func (*Amount) ProtoMessage()

func (*Amount) ProtoReflect

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

func (*Amount) Reset

func (x *Amount) Reset()

func (*Amount) String

func (x *Amount) String() string

type Farewell

type Farewell struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Farewell) Descriptor deprecated

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

Deprecated: Use Farewell.ProtoReflect.Descriptor instead.

func (*Farewell) GetMessage

func (x *Farewell) GetMessage() string

func (*Farewell) ProtoMessage

func (*Farewell) ProtoMessage()

func (*Farewell) ProtoReflect

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

func (*Farewell) Reset

func (x *Farewell) Reset()

func (*Farewell) String

func (x *Farewell) String() string

type Greeding

type Greeding struct {
	ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"`
	Message    string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Greeding) Descriptor deprecated

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

Deprecated: Use Greeding.ProtoReflect.Descriptor instead.

func (*Greeding) GetClientName

func (x *Greeding) GetClientName() string

func (*Greeding) GetMessage

func (x *Greeding) GetMessage() string

func (*Greeding) ProtoMessage

func (*Greeding) ProtoMessage()

func (*Greeding) ProtoReflect

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

func (*Greeding) Reset

func (x *Greeding) Reset()

func (*Greeding) String

func (x *Greeding) String() string

type TemplateClient

type TemplateClient interface {
	// one message is sent and one is recieved
	Increment(ctx context.Context, in *Amount, opts ...grpc.CallOption) (*Ack, error)
	// many messages are sent and one is recieved
	SayHi(ctx context.Context, opts ...grpc.CallOption) (Template_SayHiClient, error)
}

TemplateClient is the client API for Template 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 NewTemplateClient

func NewTemplateClient(cc grpc.ClientConnInterface) TemplateClient

type TemplateServer

type TemplateServer interface {
	// one message is sent and one is recieved
	Increment(context.Context, *Amount) (*Ack, error)
	// many messages are sent and one is recieved
	SayHi(Template_SayHiServer) error
	// contains filtered or unexported methods
}

TemplateServer is the server API for Template service. All implementations must embed UnimplementedTemplateServer for forward compatibility

type Template_SayHiClient

type Template_SayHiClient interface {
	Send(*Greeding) error
	CloseAndRecv() (*Farewell, error)
	grpc.ClientStream
}

type Template_SayHiServer

type Template_SayHiServer interface {
	SendAndClose(*Farewell) error
	Recv() (*Greeding, error)
	grpc.ServerStream
}

type UnimplementedTemplateServer

type UnimplementedTemplateServer struct {
}

UnimplementedTemplateServer must be embedded to have forward compatible implementations.

func (UnimplementedTemplateServer) Increment

func (UnimplementedTemplateServer) SayHi

type UnsafeTemplateServer

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

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

Jump to

Keyboard shortcuts

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