Documentation ¶
Overview ¶
Package servicedef is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAuthApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthApiClient) error
- func RegisterAuthApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthApiServer(s *grpc.Server, srv AuthApiServer)
- type AuthApiClient
- type AuthApiServer
- type SignInRequest
- func (*SignInRequest) Descriptor() ([]byte, []int)
- func (m *SignInRequest) GetPassword() string
- func (m *SignInRequest) GetUsername() string
- func (*SignInRequest) ProtoMessage()
- func (m *SignInRequest) Reset()
- func (m *SignInRequest) String() string
- func (m *SignInRequest) XXX_DiscardUnknown()
- func (m *SignInRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignInRequest) XXX_Merge(src proto.Message)
- func (m *SignInRequest) XXX_Size() int
- func (m *SignInRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthApiHandler ¶
func RegisterAuthApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthApiHandler registers the http handlers for service AuthApi to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthApiHandlerClient ¶
func RegisterAuthApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthApiClient) error
RegisterAuthApiHandlerClient registers the http handlers for service AuthApi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthApiClient" to call the correct interceptors.
func RegisterAuthApiHandlerFromEndpoint ¶
func RegisterAuthApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthApiHandlerFromEndpoint is same as RegisterAuthApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthApiServer ¶
func RegisterAuthApiServer(s *grpc.Server, srv AuthApiServer)
Types ¶
type AuthApiClient ¶
type AuthApiClient interface { // signin, establishing a session with cookie SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*empty.Empty, error) // signout, deleting any existing session/cookie SignOut(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) }
AuthApiClient is the client API for AuthApi service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAuthApiClient ¶
func NewAuthApiClient(cc *grpc.ClientConn) AuthApiClient
type AuthApiServer ¶
type AuthApiServer interface { // signin, establishing a session with cookie SignIn(context.Context, *SignInRequest) (*empty.Empty, error) // signout, deleting any existing session/cookie SignOut(context.Context, *empty.Empty) (*empty.Empty, error) }
AuthApiServer is the server API for AuthApi service.
type SignInRequest ¶
type SignInRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SignInRequest) Descriptor ¶
func (*SignInRequest) Descriptor() ([]byte, []int)
func (*SignInRequest) GetPassword ¶
func (m *SignInRequest) GetPassword() string
func (*SignInRequest) GetUsername ¶
func (m *SignInRequest) GetUsername() string
func (*SignInRequest) ProtoMessage ¶
func (*SignInRequest) ProtoMessage()
func (*SignInRequest) Reset ¶
func (m *SignInRequest) Reset()
func (*SignInRequest) String ¶
func (m *SignInRequest) String() string
func (*SignInRequest) XXX_DiscardUnknown ¶
func (m *SignInRequest) XXX_DiscardUnknown()
func (*SignInRequest) XXX_Marshal ¶
func (m *SignInRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignInRequest) XXX_Merge ¶
func (dst *SignInRequest) XXX_Merge(src proto.Message)
func (*SignInRequest) XXX_Size ¶
func (m *SignInRequest) XXX_Size() int
func (*SignInRequest) XXX_Unmarshal ¶
func (m *SignInRequest) XXX_Unmarshal(b []byte) error