helloworldv1

package
v0.0.0-...-fc3d56d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error_name = map[int32]string{
		0:    "ERROR_UNSPECIFIED",
		1000: "ERROR_NAME_EMPTY",
	}
	Error_value = map[string]int32{
		"ERROR_UNSPECIFIED": 0,
		"ERROR_NAME_EMPTY":  1000,
	}
)

Enum value maps for Error.

View Source
var (
	Sex_name = map[int32]string{
		0: "SEX_UNSPECIFIED",
		1: "SEX_MALE",
		2: "SEX_FEMALE",
	}
	Sex_value = map[string]int32{
		"SEX_UNSPECIFIED": 0,
		"SEX_MALE":        1,
		"SEX_FEMALE":      2,
	}
)

Enum value maps for Sex.

View Source
var File_helloworld_v1_error_proto protoreflect.FileDescriptor
View Source
var File_helloworld_v1_helloworld_proto protoreflect.FileDescriptor
View Source
var GreeterService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "helloworld.v1.GreeterService",
	HandlerType: (*GreeterServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _GreeterService_SayHello_Handler,
		},
		{
			MethodName: "SayHi",
			Handler:    _GreeterService_SayHi_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "helloworld/v1/helloworld.proto",
}

GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService 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 XERROR_ERROR_NAME_EMPTY = xerror.New(1000, "name is empty")

ERROR_NAME_EMPTY is the error code for empty name.

Functions

func RegisterGreeterServiceEchoServer

func RegisterGreeterServiceEchoServer(r *v4.Echo, srv GreeterServiceEchoServer)

func RegisterGreeterServiceServer

func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)

Types

type Error

type Error int32

Error codes for the helloworld.v1 package.

const (
	// ERROR_UNSPECIFIED is the invalid code.
	Error_ERROR_UNSPECIFIED Error = 0
	// ERROR_NAME_EMPTY is the error code for empty name.
	Error_ERROR_NAME_EMPTY Error = 1000
)

func (Error) Descriptor

func (Error) Descriptor() protoreflect.EnumDescriptor

func (Error) Enum

func (x Error) Enum() *Error

func (Error) EnumDescriptor deprecated

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

Deprecated: Use Error.Descriptor instead.

func (Error) Number

func (x Error) Number() protoreflect.EnumNumber

func (Error) String

func (x Error) String() string

func (Error) Type

func (Error) Type() protoreflect.EnumType

type GreeterServiceClient

type GreeterServiceClient interface {
	// Sends a hello greeting
	SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
	// Sends a hi greeting
	SayHi(ctx context.Context, in *SayHiRequest, opts ...grpc.CallOption) (*SayHiResponse, error)
}

GreeterServiceClient is the client API for GreeterService 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 GreeterServiceEchoServer

type GreeterServiceEchoServer interface {

	// Sends a hello greeting
	SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)

	// Sends a hi greeting
	SayHi(context.Context, *SayHiRequest) (*SayHiResponse, error)
}

type GreeterServiceServer

type GreeterServiceServer interface {
	// Sends a hello greeting
	SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
	// Sends a hi greeting
	SayHi(context.Context, *SayHiRequest) (*SayHiResponse, error)
}

GreeterServiceServer is the server API for GreeterService service. All implementations should embed UnimplementedGreeterServiceServer for forward compatibility

type SayHelloRequest

type SayHelloRequest struct {

	// name ...
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" form:"name" param:"name" uri:"name"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*SayHelloRequest) Descriptor deprecated

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

Deprecated: Use SayHelloRequest.ProtoReflect.Descriptor instead.

func (*SayHelloRequest) GetName

func (x *SayHelloRequest) GetName() string

func (*SayHelloRequest) ProtoMessage

func (*SayHelloRequest) ProtoMessage()

func (*SayHelloRequest) ProtoReflect

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

func (*SayHelloRequest) Reset

func (x *SayHelloRequest) Reset()

func (*SayHelloRequest) String

func (x *SayHelloRequest) String() string

func (*SayHelloRequest) Validate

func (m *SayHelloRequest) Validate() error

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

func (m *SayHelloRequest) ValidateAll() error

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

type SayHelloRequestMultiError

type SayHelloRequestMultiError []error

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

func (SayHelloRequestMultiError) AllErrors

func (m SayHelloRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHelloRequestMultiError) Error

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

type SayHelloRequestValidationError

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

SayHelloRequestValidationError is the validation error returned by SayHelloRequest.Validate if the designated constraints aren't met.

func (SayHelloRequestValidationError) Cause

Cause function returns cause value.

func (SayHelloRequestValidationError) Error

Error satisfies the builtin error interface

func (SayHelloRequestValidationError) ErrorName

func (e SayHelloRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SayHelloRequestValidationError) Field

Field function returns field value.

func (SayHelloRequestValidationError) Key

Key function returns key value.

func (SayHelloRequestValidationError) Reason

Reason function returns reason value.

type SayHelloResponse

type SayHelloResponse struct {

	// error
	Error uint32 `protobuf:"varint,1,opt,name=error,proto3" json:"error"`
	// msg
	Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
	// data ...
	Data *SayHelloResponse_Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data"`
	// contains filtered or unexported fields
}

The response message containing the greetings

func (*SayHelloResponse) Descriptor deprecated

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

Deprecated: Use SayHelloResponse.ProtoReflect.Descriptor instead.

func (*SayHelloResponse) GetData

func (*SayHelloResponse) GetError

func (x *SayHelloResponse) GetError() uint32

func (*SayHelloResponse) GetMsg

func (x *SayHelloResponse) GetMsg() string

func (*SayHelloResponse) ProtoMessage

func (*SayHelloResponse) ProtoMessage()

func (*SayHelloResponse) ProtoReflect

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

func (*SayHelloResponse) Reset

func (x *SayHelloResponse) Reset()

func (*SayHelloResponse) String

func (x *SayHelloResponse) String() string

func (*SayHelloResponse) Validate

func (m *SayHelloResponse) Validate() error

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

func (m *SayHelloResponse) ValidateAll() error

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

type SayHelloResponseMultiError

type SayHelloResponseMultiError []error

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

func (SayHelloResponseMultiError) AllErrors

func (m SayHelloResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHelloResponseMultiError) Error

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

type SayHelloResponseValidationError

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

SayHelloResponseValidationError is the validation error returned by SayHelloResponse.Validate if the designated constraints aren't met.

func (SayHelloResponseValidationError) Cause

Cause function returns cause value.

func (SayHelloResponseValidationError) Error

Error satisfies the builtin error interface

func (SayHelloResponseValidationError) ErrorName

ErrorName returns error name.

func (SayHelloResponseValidationError) Field

Field function returns field value.

func (SayHelloResponseValidationError) Key

Key function returns key value.

func (SayHelloResponseValidationError) Reason

Reason function returns reason value.

type SayHelloResponse_Data

type SayHelloResponse_Data struct {

	// name of the user
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
	// age_number is the age number.
	AgeNumber uint64 `protobuf:"varint,2,opt,name=age_number,json=ageNumber,proto3" json:"ageNumber"`
	// sex is the user's sex
	Sex Sex `protobuf:"varint,3,opt,name=sex,proto3,enum=helloworld.v1.Sex" json:"sex"`
	// metadata is the user's metadata
	Metadata map[string]string `` /* 147-byte string literal not displayed */
	// contains filtered or unexported fields
}

Data is the data to be sent.

func (*SayHelloResponse_Data) Descriptor deprecated

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

Deprecated: Use SayHelloResponse_Data.ProtoReflect.Descriptor instead.

func (*SayHelloResponse_Data) GetAgeNumber

func (x *SayHelloResponse_Data) GetAgeNumber() uint64

func (*SayHelloResponse_Data) GetMetadata

func (x *SayHelloResponse_Data) GetMetadata() map[string]string

func (*SayHelloResponse_Data) GetName

func (x *SayHelloResponse_Data) GetName() string

func (*SayHelloResponse_Data) GetSex

func (x *SayHelloResponse_Data) GetSex() Sex

func (*SayHelloResponse_Data) ProtoMessage

func (*SayHelloResponse_Data) ProtoMessage()

func (*SayHelloResponse_Data) ProtoReflect

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

func (*SayHelloResponse_Data) Reset

func (x *SayHelloResponse_Data) Reset()

func (*SayHelloResponse_Data) String

func (x *SayHelloResponse_Data) String() string

func (*SayHelloResponse_Data) Validate

func (m *SayHelloResponse_Data) Validate() error

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

func (m *SayHelloResponse_Data) ValidateAll() error

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

type SayHelloResponse_DataMultiError

type SayHelloResponse_DataMultiError []error

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

func (SayHelloResponse_DataMultiError) AllErrors

func (m SayHelloResponse_DataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHelloResponse_DataMultiError) Error

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

type SayHelloResponse_DataValidationError

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

SayHelloResponse_DataValidationError is the validation error returned by SayHelloResponse_Data.Validate if the designated constraints aren't met.

func (SayHelloResponse_DataValidationError) Cause

Cause function returns cause value.

func (SayHelloResponse_DataValidationError) Error

Error satisfies the builtin error interface

func (SayHelloResponse_DataValidationError) ErrorName

ErrorName returns error name.

func (SayHelloResponse_DataValidationError) Field

Field function returns field value.

func (SayHelloResponse_DataValidationError) Key

Key function returns key value.

func (SayHelloResponse_DataValidationError) Reason

Reason function returns reason value.

type SayHiRequest

type SayHiRequest struct {

	// name ...
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" form:"name"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*SayHiRequest) Descriptor deprecated

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

Deprecated: Use SayHiRequest.ProtoReflect.Descriptor instead.

func (*SayHiRequest) GetName

func (x *SayHiRequest) GetName() string

func (*SayHiRequest) ProtoMessage

func (*SayHiRequest) ProtoMessage()

func (*SayHiRequest) ProtoReflect

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

func (*SayHiRequest) Reset

func (x *SayHiRequest) Reset()

func (*SayHiRequest) String

func (x *SayHiRequest) String() string

func (*SayHiRequest) Validate

func (m *SayHiRequest) Validate() error

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

func (m *SayHiRequest) ValidateAll() error

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

type SayHiRequestMultiError

type SayHiRequestMultiError []error

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

func (SayHiRequestMultiError) AllErrors

func (m SayHiRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHiRequestMultiError) Error

func (m SayHiRequestMultiError) Error() string

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

type SayHiRequestValidationError

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

SayHiRequestValidationError is the validation error returned by SayHiRequest.Validate if the designated constraints aren't met.

func (SayHiRequestValidationError) Cause

Cause function returns cause value.

func (SayHiRequestValidationError) Error

Error satisfies the builtin error interface

func (SayHiRequestValidationError) ErrorName

func (e SayHiRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SayHiRequestValidationError) Field

Field function returns field value.

func (SayHiRequestValidationError) Key

Key function returns key value.

func (SayHiRequestValidationError) Reason

Reason function returns reason value.

type SayHiResponse

type SayHiResponse struct {

	// error
	Error uint32 `protobuf:"varint,1,opt,name=error,proto3" json:"error"`
	// msg
	Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
	// data ...
	Data *SayHiResponse_Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data"`
	// contains filtered or unexported fields
}

The response message containing the greetings

func (*SayHiResponse) Descriptor deprecated

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

Deprecated: Use SayHiResponse.ProtoReflect.Descriptor instead.

func (*SayHiResponse) GetData

func (x *SayHiResponse) GetData() *SayHiResponse_Data

func (*SayHiResponse) GetError

func (x *SayHiResponse) GetError() uint32

func (*SayHiResponse) GetMsg

func (x *SayHiResponse) GetMsg() string

func (*SayHiResponse) ProtoMessage

func (*SayHiResponse) ProtoMessage()

func (*SayHiResponse) ProtoReflect

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

func (*SayHiResponse) Reset

func (x *SayHiResponse) Reset()

func (*SayHiResponse) String

func (x *SayHiResponse) String() string

func (*SayHiResponse) Validate

func (m *SayHiResponse) Validate() error

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

func (m *SayHiResponse) ValidateAll() error

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

type SayHiResponseMultiError

type SayHiResponseMultiError []error

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

func (SayHiResponseMultiError) AllErrors

func (m SayHiResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHiResponseMultiError) Error

func (m SayHiResponseMultiError) Error() string

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

type SayHiResponseValidationError

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

SayHiResponseValidationError is the validation error returned by SayHiResponse.Validate if the designated constraints aren't met.

func (SayHiResponseValidationError) Cause

Cause function returns cause value.

func (SayHiResponseValidationError) Error

Error satisfies the builtin error interface

func (SayHiResponseValidationError) ErrorName

func (e SayHiResponseValidationError) ErrorName() string

ErrorName returns error name.

func (SayHiResponseValidationError) Field

Field function returns field value.

func (SayHiResponseValidationError) Key

Key function returns key value.

func (SayHiResponseValidationError) Reason

Reason function returns reason value.

type SayHiResponse_Data

type SayHiResponse_Data struct {

	// name of the user
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
	// age_number is the age number.
	AgeNumber uint64 `protobuf:"varint,2,opt,name=age_number,json=ageNumber,proto3" json:"ageNumber"`
	// contains filtered or unexported fields
}

Data is the data to be sent.

func (*SayHiResponse_Data) Descriptor deprecated

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

Deprecated: Use SayHiResponse_Data.ProtoReflect.Descriptor instead.

func (*SayHiResponse_Data) GetAgeNumber

func (x *SayHiResponse_Data) GetAgeNumber() uint64

func (*SayHiResponse_Data) GetName

func (x *SayHiResponse_Data) GetName() string

func (*SayHiResponse_Data) ProtoMessage

func (*SayHiResponse_Data) ProtoMessage()

func (*SayHiResponse_Data) ProtoReflect

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

func (*SayHiResponse_Data) Reset

func (x *SayHiResponse_Data) Reset()

func (*SayHiResponse_Data) String

func (x *SayHiResponse_Data) String() string

func (*SayHiResponse_Data) Validate

func (m *SayHiResponse_Data) Validate() error

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

func (m *SayHiResponse_Data) ValidateAll() error

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

type SayHiResponse_DataMultiError

type SayHiResponse_DataMultiError []error

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

func (SayHiResponse_DataMultiError) AllErrors

func (m SayHiResponse_DataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SayHiResponse_DataMultiError) Error

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

type SayHiResponse_DataValidationError

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

SayHiResponse_DataValidationError is the validation error returned by SayHiResponse_Data.Validate if the designated constraints aren't met.

func (SayHiResponse_DataValidationError) Cause

Cause function returns cause value.

func (SayHiResponse_DataValidationError) Error

Error satisfies the builtin error interface

func (SayHiResponse_DataValidationError) ErrorName

ErrorName returns error name.

func (SayHiResponse_DataValidationError) Field

Field function returns field value.

func (SayHiResponse_DataValidationError) Key

Key function returns key value.

func (SayHiResponse_DataValidationError) Reason

Reason function returns reason value.

type Sex

type Sex int32

Sex

const (
	// SEX_UNSPECIFIED ...
	Sex_SEX_UNSPECIFIED Sex = 0
	// SEX_MALE ...
	Sex_SEX_MALE Sex = 1
	// SEX_FEMALE ...
	Sex_SEX_FEMALE Sex = 2
)

func (Sex) Descriptor

func (Sex) Descriptor() protoreflect.EnumDescriptor

func (Sex) Enum

func (x Sex) Enum() *Sex

func (Sex) EnumDescriptor deprecated

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

Deprecated: Use Sex.Descriptor instead.

func (Sex) Number

func (x Sex) Number() protoreflect.EnumNumber

func (Sex) String

func (x Sex) String() string

func (Sex) Type

func (Sex) Type() protoreflect.EnumType

type UnimplementedGreeterServiceServer

type UnimplementedGreeterServiceServer struct {
}

UnimplementedGreeterServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedGreeterServiceServer) SayHello

func (UnimplementedGreeterServiceServer) SayHi

type UnsafeGreeterServiceServer

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

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

Jump to

Keyboard shortcuts

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