local

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

type Gateway struct {
	Server *http.Server

	sync.RWMutex
	// contains filtered or unexported fields
}

Gateway implements API Manager Gateway using local HTTP server.

func NewGateway

func NewGateway(functionsClient client.FunctionsClient) (*Gateway, error)

NewGateway creates a new local API gateway

func (*Gateway) AddAPI

func (g *Gateway) AddAPI(ctx context.Context, entity *gateway.API) (*gateway.API, error)

AddAPI adds an API to internal registry

func (*Gateway) DeleteAPI

func (g *Gateway) DeleteAPI(ctx context.Context, api *gateway.API) error

DeleteAPI deletes the API

func (*Gateway) GetAPI

func (g *Gateway) GetAPI(ctx context.Context, name string) (*gateway.API, error)

GetAPI gets the API

func (*Gateway) Serve

func (g *Gateway) Serve() error

Serve sets the handler and starts the API Gateway HTTP server

func (*Gateway) ServeHTTP

func (g *Gateway) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler interface.

func (*Gateway) Shutdown

func (g *Gateway) Shutdown() error

Shutdown gracefully stops the HTTP server.

func (*Gateway) UpdateAPI

func (g *Gateway) UpdateAPI(ctx context.Context, name string, entity *gateway.API) (*gateway.API, error)

UpdateAPI updates the API

Jump to

Keyboard shortcuts

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