v5.10.1+incompatible Latest Latest

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT Imports: 20 Imported by: 0




This section is empty.


This section is empty.


func NewSubrouter

func NewSubrouter(r *mux.Route, ms ...middlewares.HTTPMiddleware) *mux.Router

NewSubrouter returns new router given route and set of middleware. Useful when you would like a subset of routes that are wrapped in a specific set of middleware. Eg. you would some routes to require authetication while others you would not.


type APId

type APId struct {
	Authenticator    *authentication.Authenticator
	HTTPServer       *http.Server
	CoreSubrouter    *mux.Router
	GraphQLSubrouter *mux.Router
	// contains filtered or unexported fields

APId is the backend HTTP API.

func New

func New(c Config, opts ...Option) (*APId, error)

New creates a new APId.

func (*APId) Err

func (a *APId) Err() <-chan error

Err returns a channel to listen for terminal errors on.

func (*APId) Name

func (a *APId) Name() string

Name returns the daemon name

func (*APId) Start

func (a *APId) Start() error

Start APId.

func (*APId) Stop

func (a *APId) Stop() error

Stop httpApi.

type Config

type Config struct {
	ListenAddress       string
	URL                 string
	Bus                 messaging.MessageBus
	Store               store.Store
	EventStore          store.EventStore
	QueueGetter         types.QueueGetter
	TLS                 *types.TLSOptions
	Cluster             clientv3.Cluster
	EtcdClientTLSConfig *tls.Config
	Authenticator       *authentication.Authenticator
	ClusterVersion      string

Config configures APId.

type Option

type Option func(*APId) error

Option is a functional option.

type WrappedRouter

type WrappedRouter struct {
	// contains filtered or unexported fields

WrappedRouter is equivelant to mux.Router with the addition that any time it handles a request the given middleware stack is applied first.

func (*WrappedRouter) Match

func (r *WrappedRouter) Match(req *http.Request, match *mux.RouteMatch) bool

Match matches registered routes against the request.


Path Synopsis

Jump to

Keyboard shortcuts

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