Documentation ¶
Overview ¶
Package service is a generated protocol buffer package.
It is generated from these files:
proto/service/service.proto
It has these top-level messages:
CreateUserRequest GetUserRequest GreetUserRequest GreetUserResponse User
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterSimpleServerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSimpleServerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSimpleServerServer(s *grpc.Server, srv SimpleServerServer)
- type CreateUserRequest
- type GetUserRequest
- type GreetUserRequest
- type GreetUserResponse
- type SimpleServerClient
- type SimpleServerServer
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSimpleServerHandler ¶
func RegisterSimpleServerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSimpleServerHandler registers the http handlers for service SimpleServer to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSimpleServerHandlerFromEndpoint ¶
func RegisterSimpleServerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSimpleServerHandlerFromEndpoint is same as RegisterSimpleServerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSimpleServerServer ¶
func RegisterSimpleServerServer(s *grpc.Server, srv SimpleServerServer)
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct {
User *User `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
}
func (*CreateUserRequest) Descriptor ¶
func (*CreateUserRequest) Descriptor() ([]byte, []int)
func (*CreateUserRequest) GetUser ¶
func (m *CreateUserRequest) GetUser() *User
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) Reset ¶
func (m *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (m *CreateUserRequest) String() string
type GetUserRequest ¶
type GetUserRequest struct {
Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
}
func (*GetUserRequest) Descriptor ¶
func (*GetUserRequest) Descriptor() ([]byte, []int)
func (*GetUserRequest) GetUsername ¶
func (m *GetUserRequest) GetUsername() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) Reset ¶
func (m *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (m *GetUserRequest) String() string
type GreetUserRequest ¶
type GreetUserRequest struct { Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` Greeting string `protobuf:"bytes,2,opt,name=greeting" json:"greeting,omitempty"` }
func (*GreetUserRequest) Descriptor ¶
func (*GreetUserRequest) Descriptor() ([]byte, []int)
func (*GreetUserRequest) GetGreeting ¶
func (m *GreetUserRequest) GetGreeting() string
func (*GreetUserRequest) GetUsername ¶
func (m *GreetUserRequest) GetUsername() string
func (*GreetUserRequest) ProtoMessage ¶
func (*GreetUserRequest) ProtoMessage()
func (*GreetUserRequest) Reset ¶
func (m *GreetUserRequest) Reset()
func (*GreetUserRequest) String ¶
func (m *GreetUserRequest) String() string
type GreetUserResponse ¶
type GreetUserResponse struct {
Greeting string `protobuf:"bytes,1,opt,name=greeting" json:"greeting,omitempty"`
}
func (*GreetUserResponse) Descriptor ¶
func (*GreetUserResponse) Descriptor() ([]byte, []int)
func (*GreetUserResponse) GetGreeting ¶
func (m *GreetUserResponse) GetGreeting() string
func (*GreetUserResponse) ProtoMessage ¶
func (*GreetUserResponse) ProtoMessage()
func (*GreetUserResponse) Reset ¶
func (m *GreetUserResponse) Reset()
func (*GreetUserResponse) String ¶
func (m *GreetUserResponse) String() string
type SimpleServerClient ¶
type SimpleServerClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) GreetUser(ctx context.Context, in *GreetUserRequest, opts ...grpc.CallOption) (*GreetUserResponse, error) }
func NewSimpleServerClient ¶
func NewSimpleServerClient(cc *grpc.ClientConn) SimpleServerClient
type SimpleServerServer ¶
type SimpleServerServer interface { CreateUser(context.Context, *CreateUserRequest) (*google_protobuf.Empty, error) GetUser(context.Context, *GetUserRequest) (*User, error) GreetUser(context.Context, *GreetUserRequest) (*GreetUserResponse, error) }
type User ¶
type User struct { Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` Role string `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"` }
func (*User) Descriptor ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.