v1

package
v0.0.0-...-3a46aa3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.example.ExampleService",
	HandlerType: (*ExampleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TestValidate",
			Handler:    _ExampleService_TestValidate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example.proto",
}

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

View Source
var File_example_proto protoreflect.FileDescriptor

Functions

func RegisterExampleServiceHTTPServer

func RegisterExampleServiceHTTPServer(s *http.Server, srv ExampleServiceHTTPServer)

func RegisterExampleServiceServer

func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)

Types

type ExampleServiceClient

type ExampleServiceClient interface {
	TestValidate(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
}

ExampleServiceClient is the client API for ExampleService 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.

type ExampleServiceHTTPClient

type ExampleServiceHTTPClient interface {
	TestValidate(ctx context.Context, req *Request, opts ...http.CallOption) (rsp *Reply, err error)
}

func NewExampleServiceHTTPClient

func NewExampleServiceHTTPClient(client *http.Client) ExampleServiceHTTPClient

type ExampleServiceHTTPClientImpl

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

func (*ExampleServiceHTTPClientImpl) TestValidate

func (c *ExampleServiceHTTPClientImpl) TestValidate(ctx context.Context, in *Request, opts ...http.CallOption) (*Reply, error)

type ExampleServiceHTTPServer

type ExampleServiceHTTPServer interface {
	TestValidate(context.Context, *Request) (*Reply, error)
}

type ExampleServiceServer

type ExampleServiceServer interface {
	TestValidate(context.Context, *Request) (*Reply, error)
	// contains filtered or unexported methods
}

ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility

type Info

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

func (*Info) Descriptor deprecated

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

Deprecated: Use Info.ProtoReflect.Descriptor instead.

func (*Info) GetAddress

func (x *Info) GetAddress() string

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) ProtoReflect

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

func (*Info) Reset

func (x *Info) Reset()

func (*Info) String

func (x *Info) String() string

func (*Info) Validate

func (m *Info) Validate() error

Validate checks the field values on Info 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 (*Info) ValidateAll

func (m *Info) ValidateAll() error

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

type InfoMultiError

type InfoMultiError []error

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

func (InfoMultiError) AllErrors

func (m InfoMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (InfoMultiError) Error

func (m InfoMultiError) Error() string

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

type InfoValidationError

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

InfoValidationError is the validation error returned by Info.Validate if the designated constraints aren't met.

func (InfoValidationError) Cause

func (e InfoValidationError) Cause() error

Cause function returns cause value.

func (InfoValidationError) Error

func (e InfoValidationError) Error() string

Error satisfies the builtin error interface

func (InfoValidationError) ErrorName

func (e InfoValidationError) ErrorName() string

ErrorName returns error name.

func (InfoValidationError) Field

func (e InfoValidationError) Field() string

Field function returns field value.

func (InfoValidationError) Key

func (e InfoValidationError) Key() bool

Key function returns key value.

func (InfoValidationError) Reason

func (e InfoValidationError) Reason() string

Reason function returns reason value.

type Reply

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

func (*Reply) Descriptor deprecated

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

Deprecated: Use Reply.ProtoReflect.Descriptor instead.

func (*Reply) GetMessage

func (x *Reply) GetMessage() string

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) ProtoReflect

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

func (*Reply) Reset

func (x *Reply) Reset()

func (*Reply) String

func (x *Reply) String() string

func (*Reply) Validate

func (m *Reply) Validate() error

Validate checks the field values on Reply 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 (*Reply) ValidateAll

func (m *Reply) ValidateAll() error

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

type ReplyMultiError

type ReplyMultiError []error

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

func (ReplyMultiError) AllErrors

func (m ReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ReplyMultiError) Error

func (m ReplyMultiError) Error() string

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

type ReplyValidationError

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

ReplyValidationError is the validation error returned by Reply.Validate if the designated constraints aren't met.

func (ReplyValidationError) Cause

func (e ReplyValidationError) Cause() error

Cause function returns cause value.

func (ReplyValidationError) Error

func (e ReplyValidationError) Error() string

Error satisfies the builtin error interface

func (ReplyValidationError) ErrorName

func (e ReplyValidationError) ErrorName() string

ErrorName returns error name.

func (ReplyValidationError) Field

func (e ReplyValidationError) Field() string

Field function returns field value.

func (ReplyValidationError) Key

func (e ReplyValidationError) Key() bool

Key function returns key value.

func (ReplyValidationError) Reason

func (e ReplyValidationError) Reason() string

Reason function returns reason value.

type Request

type Request struct {
	Id      int64   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Age     int32   `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"`
	Code    uint32  `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"`
	Score   float32 `protobuf:"fixed32,4,opt,name=score,proto3" json:"score,omitempty"`
	State   bool    `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"`
	Path    string  `protobuf:"bytes,6,opt,name=path,proto3" json:"path,omitempty"`
	Phone   string  `protobuf:"bytes,7,opt,name=phone,proto3" json:"phone,omitempty"`
	Explain string  `protobuf:"bytes,8,opt,name=explain,proto3" json:"explain,omitempty"`
	Name    string  `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"`
	Card    string  `protobuf:"bytes,10,opt,name=card,proto3" json:"card,omitempty"`
	Info    *Info   `protobuf:"bytes,11,opt,name=info,proto3" json:"info,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetAge

func (x *Request) GetAge() int32

func (*Request) GetCard

func (x *Request) GetCard() string

func (*Request) GetCode

func (x *Request) GetCode() uint32

func (*Request) GetExplain

func (x *Request) GetExplain() string

func (*Request) GetId

func (x *Request) GetId() int64

func (*Request) GetInfo

func (x *Request) GetInfo() *Info

func (*Request) GetName

func (x *Request) GetName() string

func (*Request) GetPath

func (x *Request) GetPath() string

func (*Request) GetPhone

func (x *Request) GetPhone() string

func (*Request) GetScore

func (x *Request) GetScore() float32

func (*Request) GetState

func (x *Request) GetState() bool

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

func (*Request) Validate

func (m *Request) Validate() error

Validate checks the field values on Request 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 (*Request) ValidateAll

func (m *Request) ValidateAll() error

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

type RequestMultiError

type RequestMultiError []error

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

func (RequestMultiError) AllErrors

func (m RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RequestMultiError) Error

func (m RequestMultiError) Error() string

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

type RequestValidationError

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

RequestValidationError is the validation error returned by Request.Validate if the designated constraints aren't met.

func (RequestValidationError) Cause

func (e RequestValidationError) Cause() error

Cause function returns cause value.

func (RequestValidationError) Error

func (e RequestValidationError) Error() string

Error satisfies the builtin error interface

func (RequestValidationError) ErrorName

func (e RequestValidationError) ErrorName() string

ErrorName returns error name.

func (RequestValidationError) Field

func (e RequestValidationError) Field() string

Field function returns field value.

func (RequestValidationError) Key

func (e RequestValidationError) Key() bool

Key function returns key value.

func (RequestValidationError) Reason

func (e RequestValidationError) Reason() string

Reason function returns reason value.

type UnimplementedExampleServiceServer

type UnimplementedExampleServiceServer struct {
}

UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleServiceServer) TestValidate

type UnsafeExampleServiceServer

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

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

Jump to

Keyboard shortcuts

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