pb

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_greeter_proto protoreflect.FileDescriptor

Functions

func GreeterServiceClientType

func GreeterServiceClientType() reflect.Type

GreeterServiceClientType .

func GreeterServiceHandlerType

func GreeterServiceHandlerType() reflect.Type

GreeterServiceHandlerType .

func GreeterServiceServerType

func GreeterServiceServerType() reflect.Type

GreeterServiceServerType .

func RegisterGreeterServiceHandler

func RegisterGreeterServiceHandler(r http.Router, srv GreeterServiceHandler, opts ...http.HandleOption)

RegisterGreeterServiceHandler register GreeterServiceHandler to http.Router.

func RegisterGreeterServiceImp

func RegisterGreeterServiceImp(regester transport.Register, srv GreeterServiceServer, opts ...transport.ServiceOption)

RegisterGreeterServiceImp greeter.proto

func RegisterGreeterServiceServer

func RegisterGreeterServiceServer(s grpc1.ServiceRegistrar, srv GreeterServiceServer, opts ...grpc1.HandleOption)

func RegisterUserServiceHandler

func RegisterUserServiceHandler(r http.Router, srv UserServiceHandler, opts ...http.HandleOption)

RegisterUserServiceHandler register UserServiceHandler to http.Router.

func RegisterUserServiceImp

func RegisterUserServiceImp(regester transport.Register, srv UserServiceServer, opts ...transport.ServiceOption)

RegisterUserServiceImp user.proto

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc1.ServiceRegistrar, srv UserServiceServer, opts ...grpc1.HandleOption)

func ServiceNames

func ServiceNames(svr ...string) []string

ServiceNames return all service names

func Types

func Types() []reflect.Type

func UserServiceClientType

func UserServiceClientType() reflect.Type

UserServiceClientType .

func UserServiceHandlerType

func UserServiceHandlerType() reflect.Type

UserServiceHandlerType .

func UserServiceServerType

func UserServiceServerType() reflect.Type

UserServiceServerType .

Types

type GetUserRequest

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

func (*GetUserRequest) Descriptor deprecated

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

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetId

func (x *GetUserRequest) GetId() string

func (*GetUserRequest) MarshalJSON

func (m *GetUserRequest) MarshalJSON() ([]byte, error)

GetUserRequest implement json.Marshaler.

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect

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

func (*GetUserRequest) Reset

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String

func (x *GetUserRequest) String() string

func (*GetUserRequest) UnmarshalJSON

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

GetUserRequest implement json.Marshaler.

func (*GetUserRequest) UnmarshalURLValues

func (m *GetUserRequest) UnmarshalURLValues(prefix string, values url.Values) error

GetUserRequest implement urlenc.URLValuesUnmarshaler.

func (*GetUserRequest) Validate

func (this *GetUserRequest) Validate() error

type GetUserResponse

type GetUserResponse struct {
	Success bool  `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Data    *User `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserResponse) Descriptor deprecated

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

Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.

func (*GetUserResponse) GetData

func (x *GetUserResponse) GetData() *User

func (*GetUserResponse) GetSuccess

func (x *GetUserResponse) GetSuccess() bool

func (*GetUserResponse) MarshalJSON

func (m *GetUserResponse) MarshalJSON() ([]byte, error)

GetUserResponse implement json.Marshaler.

func (*GetUserResponse) ProtoMessage

func (*GetUserResponse) ProtoMessage()

func (*GetUserResponse) ProtoReflect

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

func (*GetUserResponse) Reset

func (x *GetUserResponse) Reset()

func (*GetUserResponse) String

func (x *GetUserResponse) String() string

func (*GetUserResponse) UnmarshalJSON

func (m *GetUserResponse) UnmarshalJSON(b []byte) error

GetUserResponse implement json.Marshaler.

func (*GetUserResponse) UnmarshalURLValues

func (m *GetUserResponse) UnmarshalURLValues(prefix string, values url.Values) error

GetUserResponse implement urlenc.URLValuesUnmarshaler.

func (*GetUserResponse) Validate

func (this *GetUserResponse) Validate() error

type GreeterServiceClient

type GreeterServiceClient interface {
	// say hello
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, 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 GreeterServiceHandler

type GreeterServiceHandler interface {
	// say hello
	// GET /api/hello/{name}
	SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
}

GreeterServiceHandler is the server API for GreeterService service.

type GreeterServiceServer

type GreeterServiceServer interface {
	// say hello
	SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
}

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

type HelloRequest

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

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) MarshalJSON

func (m *HelloRequest) MarshalJSON() ([]byte, error)

HelloRequest implement json.Marshaler.

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

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

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

func (*HelloRequest) UnmarshalJSON

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

HelloRequest implement json.Marshaler.

func (*HelloRequest) UnmarshalURLValues

func (m *HelloRequest) UnmarshalURLValues(prefix string, values url.Values) error

HelloRequest implement urlenc.URLValuesUnmarshaler.

func (*HelloRequest) Validate

func (this *HelloRequest) Validate() error

type HelloResponse

type HelloResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Data    string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloResponse) Descriptor deprecated

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetData

func (x *HelloResponse) GetData() string

func (*HelloResponse) GetSuccess

func (x *HelloResponse) GetSuccess() bool

func (*HelloResponse) MarshalJSON

func (m *HelloResponse) MarshalJSON() ([]byte, error)

HelloResponse implement json.Marshaler.

func (*HelloResponse) ProtoMessage

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) ProtoReflect

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

func (*HelloResponse) Reset

func (x *HelloResponse) Reset()

func (*HelloResponse) String

func (x *HelloResponse) String() string

func (*HelloResponse) UnmarshalJSON

func (m *HelloResponse) UnmarshalJSON(b []byte) error

HelloResponse implement json.Marshaler.

func (*HelloResponse) UnmarshalURLValues

func (m *HelloResponse) UnmarshalURLValues(prefix string, values url.Values) error

HelloResponse implement urlenc.URLValuesUnmarshaler.

func (*HelloResponse) Validate

func (this *HelloResponse) Validate() error

type UnimplementedGreeterServiceServer

type UnimplementedGreeterServiceServer struct {
}

UnimplementedGreeterServiceServer should be embedded to have forward compatible implementations.

func (*UnimplementedGreeterServiceServer) SayHello

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer should be embedded to have forward compatible implementations.

func (*UnimplementedUserServiceServer) GetUser

func (*UnimplementedUserServiceServer) UpdateUser

type UpdateUserRequest

type UpdateUserRequest struct {
	Data *User `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateUserRequest) Descriptor deprecated

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

Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.

func (*UpdateUserRequest) GetData

func (x *UpdateUserRequest) GetData() *User

func (*UpdateUserRequest) MarshalJSON

func (m *UpdateUserRequest) MarshalJSON() ([]byte, error)

UpdateUserRequest implement json.Marshaler.

func (*UpdateUserRequest) ProtoMessage

func (*UpdateUserRequest) ProtoMessage()

func (*UpdateUserRequest) ProtoReflect

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

func (*UpdateUserRequest) Reset

func (x *UpdateUserRequest) Reset()

func (*UpdateUserRequest) String

func (x *UpdateUserRequest) String() string

func (*UpdateUserRequest) UnmarshalJSON

func (m *UpdateUserRequest) UnmarshalJSON(b []byte) error

UpdateUserRequest implement json.Marshaler.

func (*UpdateUserRequest) UnmarshalURLValues

func (m *UpdateUserRequest) UnmarshalURLValues(prefix string, values url.Values) error

UpdateUserRequest implement urlenc.URLValuesUnmarshaler.

func (*UpdateUserRequest) Validate

func (this *UpdateUserRequest) Validate() error

type UpdateUserResponse

type UpdateUserResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateUserResponse) Descriptor deprecated

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

Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.

func (*UpdateUserResponse) GetSuccess

func (x *UpdateUserResponse) GetSuccess() bool

func (*UpdateUserResponse) MarshalJSON

func (m *UpdateUserResponse) MarshalJSON() ([]byte, error)

UpdateUserResponse implement json.Marshaler.

func (*UpdateUserResponse) ProtoMessage

func (*UpdateUserResponse) ProtoMessage()

func (*UpdateUserResponse) ProtoReflect

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

func (*UpdateUserResponse) Reset

func (x *UpdateUserResponse) Reset()

func (*UpdateUserResponse) String

func (x *UpdateUserResponse) String() string

func (*UpdateUserResponse) UnmarshalJSON

func (m *UpdateUserResponse) UnmarshalJSON(b []byte) error

UpdateUserResponse implement json.Marshaler.

func (*UpdateUserResponse) UnmarshalURLValues

func (m *UpdateUserResponse) UnmarshalURLValues(prefix string, values url.Values) error

UpdateUserResponse implement urlenc.URLValuesUnmarshaler.

func (*UpdateUserResponse) Validate

func (this *UpdateUserResponse) Validate() error

type User

type User struct {
	Id   int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Age  int32  `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAge

func (x *User) GetAge() int32

func (*User) GetId

func (x *User) GetId() int64

func (*User) GetName

func (x *User) GetName() string

func (*User) MarshalJSON

func (m *User) MarshalJSON() ([]byte, error)

User implement json.Marshaler.

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) UnmarshalJSON

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

User implement json.Marshaler.

func (*User) UnmarshalURLValues

func (m *User) UnmarshalURLValues(prefix string, values url.Values) error

User implement urlenc.URLValuesUnmarshaler.

func (*User) Validate

func (this *User) Validate() error

type UserServiceClient

type UserServiceClient interface {
	// get user
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
	// update user
	UpdateUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
}

UserServiceClient is the client API for UserService 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 UserServiceHandler

type UserServiceHandler interface {
	// get user
	// GET /api/user/{id}
	GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
	// update user
	// PUT /api/user/{id}
	UpdateUser(context.Context, *GetUserRequest) (*UpdateUserResponse, error)
}

UserServiceHandler is the server API for UserService service.

type UserServiceServer

type UserServiceServer interface {
	// get user
	GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
	// update user
	UpdateUser(context.Context, *GetUserRequest) (*UpdateUserResponse, error)
}

UserServiceServer is the server API for UserService service. All implementations should embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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