Documentation
¶
Overview ¶
Package pb is a generated protocol buffer package.
It is generated from these files:
pb/app.proto
It has these top-level messages:
AuthRequestMessage AuthResponseMessage UserMessage
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthServer(s *grpc.Server, srv AuthServer)
- type AuthClient
- type AuthRequestMessage
- func (*AuthRequestMessage) Descriptor() ([]byte, []int)
- func (m *AuthRequestMessage) GetGrantType() string
- func (m *AuthRequestMessage) GetPassword() string
- func (m *AuthRequestMessage) GetUsername() string
- func (*AuthRequestMessage) ProtoMessage()
- func (m *AuthRequestMessage) Reset()
- func (m *AuthRequestMessage) String() string
- type AuthResponseMessage
- func (*AuthResponseMessage) Descriptor() ([]byte, []int)
- func (m *AuthResponseMessage) GetAccessToken() string
- func (m *AuthResponseMessage) GetExpiresIn() int64
- func (m *AuthResponseMessage) GetTokenType() string
- func (*AuthResponseMessage) ProtoMessage()
- func (m *AuthResponseMessage) Reset()
- func (m *AuthResponseMessage) String() string
- type AuthServer
- type UserMessage
- func (*UserMessage) Descriptor() ([]byte, []int)
- func (m *UserMessage) GetId() string
- func (m *UserMessage) GetName() string
- func (m *UserMessage) GetPassword() string
- func (m *UserMessage) GetRole() string
- func (m *UserMessage) GetUsername() string
- func (*UserMessage) ProtoMessage()
- func (m *UserMessage) Reset()
- func (m *UserMessage) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthHandler ¶
RegisterAuthHandler registers the http handlers for service Auth to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthHandlerFromEndpoint ¶
func RegisterAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthHandlerFromEndpoint is same as RegisterAuthHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServer ¶
func RegisterAuthServer(s *grpc.Server, srv AuthServer)
Types ¶
type AuthClient ¶
type AuthClient interface {
Auth(ctx context.Context, in *AuthRequestMessage, opts ...grpc.CallOption) (*AuthResponseMessage, error)
}
func NewAuthClient ¶
func NewAuthClient(cc *grpc.ClientConn) AuthClient
type AuthRequestMessage ¶
type AuthRequestMessage struct {
GrantType string `protobuf:"bytes,1,opt,name=grant_type,json=grantType" json:"grant_type,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"`
}
func (*AuthRequestMessage) Descriptor ¶
func (*AuthRequestMessage) Descriptor() ([]byte, []int)
func (*AuthRequestMessage) GetGrantType ¶
func (m *AuthRequestMessage) GetGrantType() string
func (*AuthRequestMessage) GetPassword ¶
func (m *AuthRequestMessage) GetPassword() string
func (*AuthRequestMessage) GetUsername ¶
func (m *AuthRequestMessage) GetUsername() string
func (*AuthRequestMessage) ProtoMessage ¶
func (*AuthRequestMessage) ProtoMessage()
func (*AuthRequestMessage) Reset ¶
func (m *AuthRequestMessage) Reset()
func (*AuthRequestMessage) String ¶
func (m *AuthRequestMessage) String() string
type AuthResponseMessage ¶
type AuthResponseMessage struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType" json:"token_type,omitempty"`
ExpiresIn int64 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn" json:"expires_in,omitempty"`
}
func (*AuthResponseMessage) Descriptor ¶
func (*AuthResponseMessage) Descriptor() ([]byte, []int)
func (*AuthResponseMessage) GetAccessToken ¶
func (m *AuthResponseMessage) GetAccessToken() string
func (*AuthResponseMessage) GetExpiresIn ¶
func (m *AuthResponseMessage) GetExpiresIn() int64
func (*AuthResponseMessage) GetTokenType ¶
func (m *AuthResponseMessage) GetTokenType() string
func (*AuthResponseMessage) ProtoMessage ¶
func (*AuthResponseMessage) ProtoMessage()
func (*AuthResponseMessage) Reset ¶
func (m *AuthResponseMessage) Reset()
func (*AuthResponseMessage) String ¶
func (m *AuthResponseMessage) String() string
type AuthServer ¶
type AuthServer interface {
Auth(context.Context, *AuthRequestMessage) (*AuthResponseMessage, error)
}
type UserMessage ¶
type UserMessage struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"`
Role string `protobuf:"bytes,5,opt,name=role" json:"role,omitempty"`
}
func (*UserMessage) Descriptor ¶
func (*UserMessage) Descriptor() ([]byte, []int)
func (*UserMessage) GetId ¶
func (m *UserMessage) GetId() string
func (*UserMessage) GetName ¶
func (m *UserMessage) GetName() string
func (*UserMessage) GetPassword ¶
func (m *UserMessage) GetPassword() string
func (*UserMessage) GetRole ¶
func (m *UserMessage) GetRole() string
func (*UserMessage) GetUsername ¶
func (m *UserMessage) GetUsername() string
func (*UserMessage) ProtoMessage ¶
func (*UserMessage) ProtoMessage()
func (*UserMessage) Reset ¶
func (m *UserMessage) Reset()
func (*UserMessage) String ¶
func (m *UserMessage) String() string
Click to show internal directories.
Click to hide internal directories.