Documentation ¶
Overview ¶
Package tokens is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterTokensMgmtHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTokensMgmtHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokensMgmtClient) error
- func RegisterTokensMgmtHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTokensMgmtServer(s *grpc.Server, srv TokensMgmtServer)
- type TokensMgmtClient
- type TokensMgmtServer
- type TokensMgmtServerMock
- func (m *TokensMgmtServerMock) CreateToken(ctx context.Context, req *request.CreateToken) (*response.Token, error)
- func (m *TokensMgmtServerMock) DeleteToken(ctx context.Context, req *request.Uuid) (*response.DeleteTokenResp, error)
- func (m *TokensMgmtServerMock) GetToken(ctx context.Context, req *request.Uuid) (*response.Token, error)
- func (m *TokensMgmtServerMock) GetTokens(ctx context.Context, req *request.GetTokensReq) (*response.Tokens, error)
- func (m *TokensMgmtServerMock) Reset()
- func (m *TokensMgmtServerMock) UpdateToken(ctx context.Context, req *request.UpdateToken) (*response.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTokensMgmtHandler ¶
func RegisterTokensMgmtHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTokensMgmtHandler registers the http handlers for service TokensMgmt to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTokensMgmtHandlerClient ¶
func RegisterTokensMgmtHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokensMgmtClient) error
RegisterTokensMgmtHandlerClient registers the http handlers for service TokensMgmt to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TokensMgmtClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TokensMgmtClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TokensMgmtClient" to call the correct interceptors.
func RegisterTokensMgmtHandlerFromEndpoint ¶
func RegisterTokensMgmtHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTokensMgmtHandlerFromEndpoint is same as RegisterTokensMgmtHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTokensMgmtServer ¶
func RegisterTokensMgmtServer(s *grpc.Server, srv TokensMgmtServer)
Types ¶
type TokensMgmtClient ¶
type TokensMgmtClient interface { GetTokens(ctx context.Context, in *request.GetTokensReq, opts ...grpc.CallOption) (*response.Tokens, error) CreateToken(ctx context.Context, in *request.CreateToken, opts ...grpc.CallOption) (*response.Token, error) UpdateToken(ctx context.Context, in *request.UpdateToken, opts ...grpc.CallOption) (*response.Token, error) GetToken(ctx context.Context, in *request.Uuid, opts ...grpc.CallOption) (*response.Token, error) DeleteToken(ctx context.Context, in *request.Uuid, opts ...grpc.CallOption) (*response.DeleteTokenResp, error) }
TokensMgmtClient is the client API for TokensMgmt service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTokensMgmtClient ¶
func NewTokensMgmtClient(cc *grpc.ClientConn) TokensMgmtClient
type TokensMgmtServer ¶
type TokensMgmtServer interface { GetTokens(context.Context, *request.GetTokensReq) (*response.Tokens, error) CreateToken(context.Context, *request.CreateToken) (*response.Token, error) UpdateToken(context.Context, *request.UpdateToken) (*response.Token, error) GetToken(context.Context, *request.Uuid) (*response.Token, error) DeleteToken(context.Context, *request.Uuid) (*response.DeleteTokenResp, error) }
TokensMgmtServer is the server API for TokensMgmt service.
type TokensMgmtServerMock ¶
type TokensMgmtServerMock struct { GetTokensFunc func(context.Context, *request.GetTokensReq) (*response.Tokens, error) CreateTokenFunc func(context.Context, *request.CreateToken) (*response.Token, error) UpdateTokenFunc func(context.Context, *request.UpdateToken) (*response.Token, error) GetTokenFunc func(context.Context, *request.Uuid) (*response.Token, error) DeleteTokenFunc func(context.Context, *request.Uuid) (*response.DeleteTokenResp, error) // contains filtered or unexported fields }
TokensMgmtServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns
func NewTokensMgmtServerMock ¶
func NewTokensMgmtServerMock() *TokensMgmtServerMock
NewTokensMgmtServerMock gives you a fresh instance of TokensMgmtServerMock.
func NewTokensMgmtServerMockWithoutValidation ¶
func NewTokensMgmtServerMockWithoutValidation() *TokensMgmtServerMock
NewTokensMgmtServerMockWithoutValidation gives you a fresh instance of TokensMgmtServerMock which does not attempt to validate requests before passing them to their respective '*Func'.
func (*TokensMgmtServerMock) CreateToken ¶
func (m *TokensMgmtServerMock) CreateToken(ctx context.Context, req *request.CreateToken) (*response.Token, error)
func (*TokensMgmtServerMock) DeleteToken ¶
func (m *TokensMgmtServerMock) DeleteToken(ctx context.Context, req *request.Uuid) (*response.DeleteTokenResp, error)
func (*TokensMgmtServerMock) GetTokens ¶
func (m *TokensMgmtServerMock) GetTokens(ctx context.Context, req *request.GetTokensReq) (*response.Tokens, error)
func (*TokensMgmtServerMock) Reset ¶
func (m *TokensMgmtServerMock) Reset()
Reset resets all overridden functions
func (*TokensMgmtServerMock) UpdateToken ¶
func (m *TokensMgmtServerMock) UpdateToken(ctx context.Context, req *request.UpdateToken) (*response.Token, error)