innkeeper

package
v0.9.119 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Overview

Package innkeeper implements a DataClient for reading skipper route definitions from an Innkeeper service.

(See the DataClient interface in the skipper/routing package.)

Innkeeper is a service to maintain large sets of routes in a multi-user environment with OAuth2 authentication and permission scopes.

See: https://github.com/zalando/innkeeper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptions

type AuthOptions struct {
	InnkeeperAuthToken  string
	OAuthCredentialsDir string
	OAuthUrl            string
	OAuthScope          string
}

type Authentication

type Authentication interface {
	GetToken() (string, error)
}

An Authentication object provides authentication to Innkeeper.

func CreateInnkeeperAuthentication

func CreateInnkeeperAuthentication(o AuthOptions) Authentication

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client is used to load the whole set of routes and the updates from an Innkeeper service.

func New

func New(o Options) (*Client, error)

Returns a new Client.

func (*Client) DeleteAllIf

func (c *Client) DeleteAllIf(routes []*eskip.Route, cond eskip.RoutePredicate) error

func (*Client) LoadAll

func (c *Client) LoadAll() ([]*eskip.Route, error)

Returns all active routes from Innkeeper.

func (*Client) LoadAndParseAll

func (c *Client) LoadAndParseAll() ([]*eskip.RouteInfo, error)

func (*Client) LoadUpdate

func (c *Client) LoadUpdate() ([]*eskip.Route, []string, error)

Returns all new and deleted routes from Innkeeper since the last LoadAll request.

func (*Client) UpsertAll

func (c *Client) UpsertAll(routes []*eskip.Route) error

type FixedToken

type FixedToken string

A FixedToken provides Innkeeper authentication by an unchanged token string.

func (FixedToken) GetToken

func (ft FixedToken) GetToken() (string, error)

Returns the fixed token.

type Options

type Options struct {

	// The network address where the Innkeeper API is accessible.
	Address string

	// When true, TLS certificate verification is skipped.
	Insecure bool

	// Authentication to be used when connecting to Innkeeper.
	Authentication Authentication

	// An eskip filter chain expression to prepend to each route loaded
	// from Innkeeper. (E.g. "filter1() -> filter2() -> filter3()")
	PreRouteFilters string

	// An eskip filter chain expression to append to each route loaded
	// from Innkeeper. (E.g. "filter1() -> filter2() -> filter3()")
	PostRouteFilters string
}

Initialization options for the Innkeeper client.

Jump to

Keyboard shortcuts

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