tokens

package
v0.0.0-...-0490640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package tokens is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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

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 (*TokensMgmtServerMock) DeleteToken

func (*TokensMgmtServerMock) GetToken

func (m *TokensMgmtServerMock) GetToken(ctx context.Context, req *request.Uuid) (*response.Token, error)

func (*TokensMgmtServerMock) GetTokens

func (*TokensMgmtServerMock) Reset

func (m *TokensMgmtServerMock) Reset()

Reset resets all overridden functions

func (*TokensMgmtServerMock) UpdateToken

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL