v1

package
v0.0.0-...-a7198d8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthGreeter        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGreeter          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGreeter = fmt.Errorf("proto: unexpected end of group")
)
View Source
var GreeterService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "helloworld.greeter.v1.GreeterService",
	HandlerType: (*GreeterServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _GreeterService_SayHello_Handler,
		},
		{
			MethodName: "GetUserInfo",
			Handler:    _GreeterService_GetUserInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/helloworld/greeter/v1/greeter.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)

Functions

func RegisterGreeterServiceHTTPServer

func RegisterGreeterServiceHTTPServer(r gin.IRouter, srv GreeterServiceHTTPServer)

func RegisterGreeterServiceServer

func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)

Types

type GetUserReply

type GetUserReply struct {
	User                 *User    `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetUserReply) Descriptor

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

func (*GetUserReply) GetUser

func (m *GetUserReply) GetUser() *User

func (*GetUserReply) Marshal

func (m *GetUserReply) Marshal() (dAtA []byte, err error)

func (*GetUserReply) MarshalTo

func (m *GetUserReply) MarshalTo(dAtA []byte) (int, error)

func (*GetUserReply) MarshalToSizedBuffer

func (m *GetUserReply) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetUserReply) ProtoMessage

func (*GetUserReply) ProtoMessage()

func (*GetUserReply) Reset

func (m *GetUserReply) Reset()

func (*GetUserReply) Size

func (m *GetUserReply) Size() (n int)

func (*GetUserReply) String

func (m *GetUserReply) String() string

func (*GetUserReply) Unmarshal

func (m *GetUserReply) Unmarshal(dAtA []byte) error

func (*GetUserReply) Validate

func (m *GetUserReply) Validate() error

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

func (m *GetUserReply) ValidateAll() error

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

func (*GetUserReply) XXX_DiscardUnknown

func (m *GetUserReply) XXX_DiscardUnknown()

func (*GetUserReply) XXX_Marshal

func (m *GetUserReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserReply) XXX_Merge

func (m *GetUserReply) XXX_Merge(src proto.Message)

func (*GetUserReply) XXX_Size

func (m *GetUserReply) XXX_Size() int

func (*GetUserReply) XXX_Unmarshal

func (m *GetUserReply) XXX_Unmarshal(b []byte) error

type GetUserReplyMultiError

type GetUserReplyMultiError []error

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

func (GetUserReplyMultiError) AllErrors

func (m GetUserReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUserReplyMultiError) Error

func (m GetUserReplyMultiError) Error() string

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

type GetUserReplyValidationError

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

GetUserReplyValidationError is the validation error returned by GetUserReply.Validate if the designated constraints aren't met.

func (GetUserReplyValidationError) Cause

Cause function returns cause value.

func (GetUserReplyValidationError) Error

Error satisfies the builtin error interface

func (GetUserReplyValidationError) ErrorName

func (e GetUserReplyValidationError) ErrorName() string

ErrorName returns error name.

func (GetUserReplyValidationError) Field

Field function returns field value.

func (GetUserReplyValidationError) Key

Key function returns key value.

func (GetUserReplyValidationError) Reason

Reason function returns reason value.

type GetUserRequest

type GetUserRequest struct {
	UserId               int64    `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" form:"user_id"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetUserRequest) Descriptor

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

func (*GetUserRequest) GetUserId

func (m *GetUserRequest) GetUserId() int64

func (*GetUserRequest) Marshal

func (m *GetUserRequest) Marshal() (dAtA []byte, err error)

func (*GetUserRequest) MarshalTo

func (m *GetUserRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetUserRequest) MarshalToSizedBuffer

func (m *GetUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) Reset

func (m *GetUserRequest) Reset()

func (*GetUserRequest) Size

func (m *GetUserRequest) Size() (n int)

func (*GetUserRequest) String

func (m *GetUserRequest) String() string

func (*GetUserRequest) Unmarshal

func (m *GetUserRequest) Unmarshal(dAtA []byte) error

func (*GetUserRequest) Validate

func (m *GetUserRequest) Validate() error

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

func (m *GetUserRequest) ValidateAll() error

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

func (*GetUserRequest) XXX_DiscardUnknown

func (m *GetUserRequest) XXX_DiscardUnknown()

func (*GetUserRequest) XXX_Marshal

func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserRequest) XXX_Merge

func (m *GetUserRequest) XXX_Merge(src proto.Message)

func (*GetUserRequest) XXX_Size

func (m *GetUserRequest) XXX_Size() int

func (*GetUserRequest) XXX_Unmarshal

func (m *GetUserRequest) XXX_Unmarshal(b []byte) error

type GetUserRequestMultiError

type GetUserRequestMultiError []error

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

func (GetUserRequestMultiError) AllErrors

func (m GetUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUserRequestMultiError) Error

func (m GetUserRequestMultiError) Error() string

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

type GetUserRequestValidationError

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

GetUserRequestValidationError is the validation error returned by GetUserRequest.Validate if the designated constraints aren't met.

func (GetUserRequestValidationError) Cause

Cause function returns cause value.

func (GetUserRequestValidationError) Error

Error satisfies the builtin error interface

func (GetUserRequestValidationError) ErrorName

func (e GetUserRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetUserRequestValidationError) Field

Field function returns field value.

func (GetUserRequestValidationError) Key

Key function returns key value.

func (GetUserRequestValidationError) Reason

Reason function returns reason value.

type GreeterService

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

func (*GreeterService) GetUserInfo_0

func (s *GreeterService) GetUserInfo_0(ctx *gin.Context)

func (*GreeterService) RegisterService

func (s *GreeterService) RegisterService()

func (*GreeterService) SayHello_0

func (s *GreeterService) SayHello_0(ctx *gin.Context)

type GreeterServiceClient

type GreeterServiceClient interface {
	// Sends a greeting
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
	GetUserInfo(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserReply, 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 GreeterServiceHTTPServer

type GreeterServiceHTTPServer interface {
	GetUserInfo(context.Context, *GetUserRequest) (*GetUserReply, error)
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
}

type GreeterServiceServer

type GreeterServiceServer interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	GetUserInfo(context.Context, *GetUserRequest) (*GetUserReply, error)
	// contains filtered or unexported methods
}

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

type HelloReply

type HelloReply struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message containing the greetings

func (*HelloReply) Descriptor

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

func (*HelloReply) GetMessage

func (m *HelloReply) GetMessage() string

func (*HelloReply) Marshal

func (m *HelloReply) Marshal() (dAtA []byte, err error)

func (*HelloReply) MarshalTo

func (m *HelloReply) MarshalTo(dAtA []byte) (int, error)

func (*HelloReply) MarshalToSizedBuffer

func (m *HelloReply) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) Reset

func (m *HelloReply) Reset()

func (*HelloReply) Size

func (m *HelloReply) Size() (n int)

func (*HelloReply) String

func (m *HelloReply) String() string

func (*HelloReply) Unmarshal

func (m *HelloReply) Unmarshal(dAtA []byte) error

func (*HelloReply) Validate

func (m *HelloReply) Validate() error

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

func (m *HelloReply) ValidateAll() error

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

func (*HelloReply) XXX_DiscardUnknown

func (m *HelloReply) XXX_DiscardUnknown()

func (*HelloReply) XXX_Marshal

func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloReply) XXX_Merge

func (m *HelloReply) XXX_Merge(src proto.Message)

func (*HelloReply) XXX_Size

func (m *HelloReply) XXX_Size() int

func (*HelloReply) XXX_Unmarshal

func (m *HelloReply) XXX_Unmarshal(b []byte) error

type HelloReplyMultiError

type HelloReplyMultiError []error

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

func (HelloReplyMultiError) AllErrors

func (m HelloReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloReplyMultiError) Error

func (m HelloReplyMultiError) Error() string

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

type HelloReplyValidationError

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

HelloReplyValidationError is the validation error returned by HelloReply.Validate if the designated constraints aren't met.

func (HelloReplyValidationError) Cause

func (e HelloReplyValidationError) Cause() error

Cause function returns cause value.

func (HelloReplyValidationError) Error

Error satisfies the builtin error interface

func (HelloReplyValidationError) ErrorName

func (e HelloReplyValidationError) ErrorName() string

ErrorName returns error name.

func (HelloReplyValidationError) Field

Field function returns field value.

func (HelloReplyValidationError) Key

Key function returns key value.

func (HelloReplyValidationError) Reason

func (e HelloReplyValidationError) Reason() string

Reason function returns reason value.

type HelloRequest

type HelloRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message containing the user's name.

func (*HelloRequest) Descriptor

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

func (*HelloRequest) GetName

func (m *HelloRequest) GetName() string

func (*HelloRequest) Marshal

func (m *HelloRequest) Marshal() (dAtA []byte, err error)

func (*HelloRequest) MarshalTo

func (m *HelloRequest) MarshalTo(dAtA []byte) (int, error)

func (*HelloRequest) MarshalToSizedBuffer

func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) Size

func (m *HelloRequest) Size() (n int)

func (*HelloRequest) String

func (m *HelloRequest) String() string

func (*HelloRequest) Unmarshal

func (m *HelloRequest) Unmarshal(dAtA []byte) error

func (*HelloRequest) Validate

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

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.

func (*HelloRequest) XXX_DiscardUnknown

func (m *HelloRequest) XXX_DiscardUnknown()

func (*HelloRequest) XXX_Marshal

func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloRequest) XXX_Merge

func (m *HelloRequest) XXX_Merge(src proto.Message)

func (*HelloRequest) XXX_Size

func (m *HelloRequest) XXX_Size() int

func (*HelloRequest) XXX_Unmarshal

func (m *HelloRequest) XXX_Unmarshal(b []byte) error

type HelloRequestMultiError

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

func (m HelloRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloRequestMultiError) Error

func (m HelloRequestMultiError) Error() string

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

type HelloRequestValidationError

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

Cause function returns cause value.

func (HelloRequestValidationError) Error

Error satisfies the builtin error interface

func (HelloRequestValidationError) ErrorName

func (e HelloRequestValidationError) ErrorName() string

ErrorName returns error name.

func (HelloRequestValidationError) Field

Field function returns field value.

func (HelloRequestValidationError) Key

Key function returns key value.

func (HelloRequestValidationError) Reason

Reason function returns reason value.

type UnimplementedGreeterServiceServer

type UnimplementedGreeterServiceServer struct {
}

UnimplementedGreeterServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServiceServer) GetUserInfo

func (UnimplementedGreeterServiceServer) SayHello

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.

type User

type User struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Username             string   `protobuf:"bytes,2,opt,name=username,proto3" json:"form:\"username\""`
	Email                string   `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Phone                string   `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	LastLoginAt          int64    `protobuf:"varint,5,opt,name=last_login_at,json=lastLoginAt,proto3" json:"last_login_at,omitempty"`
	Status               int32    `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
	Nickname             string   `protobuf:"bytes,7,opt,name=nickname,proto3" json:"form:\"nickname\""`
	Avatar               string   `protobuf:"bytes,8,opt,name=avatar,proto3" json:"avatar,omitempty"`
	Gender               int32    `protobuf:"varint,9,opt,name=gender,proto3" json:"gender,omitempty"`
	Birthday             string   `protobuf:"bytes,10,opt,name=birthday,proto3" json:"birthday,omitempty"`
	Bio                  string   `protobuf:"bytes,11,opt,name=bio,proto3" json:"bio,omitempty"`
	CreatedAt            int64    `protobuf:"varint,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt            int64    `protobuf:"varint,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

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

func (*User) GetAvatar

func (m *User) GetAvatar() string

func (*User) GetBio

func (m *User) GetBio() string

func (*User) GetBirthday

func (m *User) GetBirthday() string

func (*User) GetCreatedAt

func (m *User) GetCreatedAt() int64

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetGender

func (m *User) GetGender() int32

func (*User) GetId

func (m *User) GetId() int64

func (*User) GetLastLoginAt

func (m *User) GetLastLoginAt() int64

func (*User) GetNickname

func (m *User) GetNickname() string

func (*User) GetPhone

func (m *User) GetPhone() string

func (*User) GetStatus

func (m *User) GetStatus() int32

func (*User) GetUpdatedAt

func (m *User) GetUpdatedAt() int64

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) Marshal

func (m *User) Marshal() (dAtA []byte, err error)

func (*User) MarshalTo

func (m *User) MarshalTo(dAtA []byte) (int, error)

func (*User) MarshalToSizedBuffer

func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) Size

func (m *User) Size() (n int)

func (*User) String

func (m *User) String() string

func (*User) Unmarshal

func (m *User) Unmarshal(dAtA []byte) error

func (*User) Validate

func (m *User) Validate() error

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

func (m *User) ValidateAll() error

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

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

type UserMultiError

type UserMultiError []error

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

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

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

type UserValidationError

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

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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