Documentation ¶
Overview ¶
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package service is a generated protocol buffer package.
It is generated from these files:
proto/protobuf/v1/service/loginservice.proto proto/protobuf/v1/service/adminservice.proto
It has these top-level messages:
HelloRequest HelloResponse GetAccountsRequest GetAccountsResponse CreateAccountRequest CreateAccountResponse
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAdminServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer)
- func RegisterLoginServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLoginServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLoginServiceServer(s *grpc.Server, srv LoginServiceServer)
- type AdminServiceClient
- type AdminServiceServer
- type CreateAccountRequest
- type CreateAccountResponse
- type GetAccountsRequest
- type GetAccountsResponse
- type GetAccountsResponse_Account
- type HelloRequest
- type HelloResponse
- type LoginServiceClient
- type LoginServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdminServiceHandler ¶
func RegisterAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAdminServiceHandler registers the http handlers for service AdminService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAdminServiceHandlerFromEndpoint ¶
func RegisterAdminServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAdminServiceHandlerFromEndpoint is same as RegisterAdminServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAdminServiceServer ¶
func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer)
func RegisterLoginServiceHandler ¶
func RegisterLoginServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLoginServiceHandler registers the http handlers for service LoginService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLoginServiceHandlerFromEndpoint ¶
func RegisterLoginServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLoginServiceHandlerFromEndpoint is same as RegisterLoginServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLoginServiceServer ¶
func RegisterLoginServiceServer(s *grpc.Server, srv LoginServiceServer)
Types ¶
type AdminServiceClient ¶
type AdminServiceClient interface { CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) GetAccounts(ctx context.Context, in *GetAccountsRequest, opts ...grpc.CallOption) (*GetAccountsResponse, error) }
func NewAdminServiceClient ¶
func NewAdminServiceClient(cc *grpc.ClientConn) AdminServiceClient
type AdminServiceServer ¶
type AdminServiceServer interface { CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) GetAccounts(context.Context, *GetAccountsRequest) (*GetAccountsResponse, error) }
type CreateAccountRequest ¶
type CreateAccountRequest struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` }
func (*CreateAccountRequest) Descriptor ¶
func (*CreateAccountRequest) Descriptor() ([]byte, []int)
func (*CreateAccountRequest) GetId ¶
func (m *CreateAccountRequest) GetId() string
func (*CreateAccountRequest) GetPassword ¶
func (m *CreateAccountRequest) GetPassword() string
func (*CreateAccountRequest) ProtoMessage ¶
func (*CreateAccountRequest) ProtoMessage()
func (*CreateAccountRequest) Reset ¶
func (m *CreateAccountRequest) Reset()
func (*CreateAccountRequest) String ¶
func (m *CreateAccountRequest) String() string
type CreateAccountResponse ¶
type CreateAccountResponse struct {
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
func (*CreateAccountResponse) Descriptor ¶
func (*CreateAccountResponse) Descriptor() ([]byte, []int)
func (*CreateAccountResponse) GetMsg ¶
func (m *CreateAccountResponse) GetMsg() string
func (*CreateAccountResponse) ProtoMessage ¶
func (*CreateAccountResponse) ProtoMessage()
func (*CreateAccountResponse) Reset ¶
func (m *CreateAccountResponse) Reset()
func (*CreateAccountResponse) String ¶
func (m *CreateAccountResponse) String() string
type GetAccountsRequest ¶
type GetAccountsRequest struct { }
func (*GetAccountsRequest) Descriptor ¶
func (*GetAccountsRequest) Descriptor() ([]byte, []int)
func (*GetAccountsRequest) ProtoMessage ¶
func (*GetAccountsRequest) ProtoMessage()
func (*GetAccountsRequest) Reset ¶
func (m *GetAccountsRequest) Reset()
func (*GetAccountsRequest) String ¶
func (m *GetAccountsRequest) String() string
type GetAccountsResponse ¶
type GetAccountsResponse struct {
Accounts []*GetAccountsResponse_Account `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"`
}
func (*GetAccountsResponse) Descriptor ¶
func (*GetAccountsResponse) Descriptor() ([]byte, []int)
func (*GetAccountsResponse) GetAccounts ¶
func (m *GetAccountsResponse) GetAccounts() []*GetAccountsResponse_Account
func (*GetAccountsResponse) ProtoMessage ¶
func (*GetAccountsResponse) ProtoMessage()
func (*GetAccountsResponse) Reset ¶
func (m *GetAccountsResponse) Reset()
func (*GetAccountsResponse) String ¶
func (m *GetAccountsResponse) String() string
type GetAccountsResponse_Account ¶
type GetAccountsResponse_Account struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}
func (*GetAccountsResponse_Account) Descriptor ¶
func (*GetAccountsResponse_Account) Descriptor() ([]byte, []int)
func (*GetAccountsResponse_Account) GetId ¶
func (m *GetAccountsResponse_Account) GetId() string
func (*GetAccountsResponse_Account) ProtoMessage ¶
func (*GetAccountsResponse_Account) ProtoMessage()
func (*GetAccountsResponse_Account) Reset ¶
func (m *GetAccountsResponse_Account) Reset()
func (*GetAccountsResponse_Account) String ¶
func (m *GetAccountsResponse_Account) String() string
type HelloRequest ¶
type HelloRequest struct { }
func (*HelloRequest) Descriptor ¶
func (*HelloRequest) Descriptor() ([]byte, []int)
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) Reset ¶
func (m *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (m *HelloRequest) String() string
type HelloResponse ¶
type HelloResponse struct {
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
func (*HelloResponse) Descriptor ¶
func (*HelloResponse) Descriptor() ([]byte, []int)
func (*HelloResponse) GetMsg ¶
func (m *HelloResponse) GetMsg() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) Reset ¶
func (m *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (m *HelloResponse) String() string
type LoginServiceClient ¶
type LoginServiceClient interface {
Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}
func NewLoginServiceClient ¶
func NewLoginServiceClient(cc *grpc.ClientConn) LoginServiceClient
type LoginServiceServer ¶
type LoginServiceServer interface {
Hello(context.Context, *HelloRequest) (*HelloResponse, error)
}