service

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelloRequest_Gender_name = map[int32]string{
		0: "GENDER_MALE",
		1: "GENDER_FEMALE",
	}
	HelloRequest_Gender_value = map[string]int32{
		"GENDER_MALE":   0,
		"GENDER_FEMALE": 1,
	}
)

Enum value maps for HelloRequest_Gender.

View Source
var File_pkg_app_helloworld_service_service_proto protoreflect.FileDescriptor
View Source
var HelloWorld_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.service.helloworldservice.HelloWorld",
	HandlerType: (*HelloWorldServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Hello",
			Handler:    _HelloWorld_Hello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/app/helloworld/service/service.proto",
}

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

Functions

func RegisterHelloWorldServer added in v0.27.0

func RegisterHelloWorldServer(s grpc.ServiceRegistrar, srv HelloWorldServer)

Types

type Client

type Client interface {
	HelloWorldClient
	Close() error
}

func NewClient

func NewClient(ctx context.Context, addr string, opts ...rpcclient.DialOption) (Client, error)

type HelloRequest added in v0.27.0

type HelloRequest struct {
	Name   string              `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Gender HelloRequest_Gender `protobuf:"varint,2,opt,name=gender,proto3,enum=grpc.service.helloworldservice.HelloRequest_Gender" json:"gender,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloRequest) Descriptor deprecated added in v0.27.0

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetGender added in v0.27.0

func (x *HelloRequest) GetGender() HelloRequest_Gender

func (*HelloRequest) GetName added in v0.27.0

func (x *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage added in v0.27.0

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect added in v0.27.0

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

func (*HelloRequest) Reset added in v0.27.0

func (x *HelloRequest) Reset()

func (*HelloRequest) String added in v0.27.0

func (x *HelloRequest) String() string

func (*HelloRequest) Validate added in v0.27.0

func (m *HelloRequest) Validate() error

Validate checks the field values on HelloRequest 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 (*HelloRequest) ValidateAll added in v0.27.0

func (m *HelloRequest) ValidateAll() error

ValidateAll checks the field values on HelloRequest 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 HelloRequestMultiError, or nil if none found.

type HelloRequestMultiError added in v0.27.0

type HelloRequestMultiError []error

HelloRequestMultiError is an error wrapping multiple validation errors returned by HelloRequest.ValidateAll() if the designated constraints aren't met.

func (HelloRequestMultiError) AllErrors added in v0.27.0

func (m HelloRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloRequestMultiError) Error added in v0.27.0

func (m HelloRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HelloRequestValidationError added in v0.27.0

type HelloRequestValidationError struct {
	// contains filtered or unexported fields
}

HelloRequestValidationError is the validation error returned by HelloRequest.Validate if the designated constraints aren't met.

func (HelloRequestValidationError) Cause added in v0.27.0

Cause function returns cause value.

func (HelloRequestValidationError) Error added in v0.27.0

Error satisfies the builtin error interface

func (HelloRequestValidationError) ErrorName added in v0.27.0

func (e HelloRequestValidationError) ErrorName() string

ErrorName returns error name.

func (HelloRequestValidationError) Field added in v0.27.0

Field function returns field value.

func (HelloRequestValidationError) Key added in v0.27.0

Key function returns key value.

func (HelloRequestValidationError) Reason added in v0.27.0

Reason function returns reason value.

type HelloRequest_Gender added in v0.27.0

type HelloRequest_Gender int32
const (
	HelloRequest_GENDER_MALE   HelloRequest_Gender = 0
	HelloRequest_GENDER_FEMALE HelloRequest_Gender = 1
)

func (HelloRequest_Gender) Descriptor added in v0.27.0

func (HelloRequest_Gender) Enum added in v0.27.0

func (HelloRequest_Gender) EnumDescriptor deprecated added in v0.27.0

func (HelloRequest_Gender) EnumDescriptor() ([]byte, []int)

Deprecated: Use HelloRequest_Gender.Descriptor instead.

func (HelloRequest_Gender) Number added in v0.27.0

func (HelloRequest_Gender) String added in v0.27.0

func (x HelloRequest_Gender) String() string

func (HelloRequest_Gender) Type added in v0.27.0

type HelloResponse added in v0.27.0

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

func (*HelloResponse) Descriptor deprecated added in v0.27.0

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetMessage added in v0.27.0

func (x *HelloResponse) GetMessage() string

func (*HelloResponse) ProtoMessage added in v0.27.0

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) ProtoReflect added in v0.27.0

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

func (*HelloResponse) Reset added in v0.27.0

func (x *HelloResponse) Reset()

func (*HelloResponse) String added in v0.27.0

func (x *HelloResponse) String() string

func (*HelloResponse) Validate added in v0.27.0

func (m *HelloResponse) Validate() error

Validate checks the field values on HelloResponse 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 (*HelloResponse) ValidateAll added in v0.27.0

func (m *HelloResponse) ValidateAll() error

ValidateAll checks the field values on HelloResponse 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 HelloResponseMultiError, or nil if none found.

type HelloResponseMultiError added in v0.27.0

type HelloResponseMultiError []error

HelloResponseMultiError is an error wrapping multiple validation errors returned by HelloResponse.ValidateAll() if the designated constraints aren't met.

func (HelloResponseMultiError) AllErrors added in v0.27.0

func (m HelloResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloResponseMultiError) Error added in v0.27.0

func (m HelloResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HelloResponseValidationError added in v0.27.0

type HelloResponseValidationError struct {
	// contains filtered or unexported fields
}

HelloResponseValidationError is the validation error returned by HelloResponse.Validate if the designated constraints aren't met.

func (HelloResponseValidationError) Cause added in v0.27.0

Cause function returns cause value.

func (HelloResponseValidationError) Error added in v0.27.0

Error satisfies the builtin error interface

func (HelloResponseValidationError) ErrorName added in v0.27.0

func (e HelloResponseValidationError) ErrorName() string

ErrorName returns error name.

func (HelloResponseValidationError) Field added in v0.27.0

Field function returns field value.

func (HelloResponseValidationError) Key added in v0.27.0

Key function returns key value.

func (HelloResponseValidationError) Reason added in v0.27.0

Reason function returns reason value.

type HelloWorldClient added in v0.27.0

type HelloWorldClient interface {
	Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}

HelloWorldClient is the client API for HelloWorld 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 NewHelloWorldClient added in v0.27.0

func NewHelloWorldClient(cc grpc.ClientConnInterface) HelloWorldClient

type HelloWorldServer added in v0.27.0

type HelloWorldServer interface {
	Hello(context.Context, *HelloRequest) (*HelloResponse, error)
	// contains filtered or unexported methods
}

HelloWorldServer is the server API for HelloWorld service. All implementations must embed UnimplementedHelloWorldServer for forward compatibility

type UnimplementedHelloWorldServer added in v0.27.0

type UnimplementedHelloWorldServer struct {
}

UnimplementedHelloWorldServer must be embedded to have forward compatible implementations.

func (UnimplementedHelloWorldServer) Hello added in v0.27.0

type UnsafeHelloWorldServer added in v0.27.0

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

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

Jump to

Keyboard shortcuts

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