multitenant

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotFound is returned by ConsulClient.Get
	ErrNotFound = fmt.Errorf("Not found")
)
View Source
var ErrUserIDNotFound = fmt.Errorf("User ID not found")

ErrUserIDNotFound should be returned by a UserIDer when it fails to ID the user for a request.

Functions

func NewConsulPipeRouter

func NewConsulPipeRouter(client ConsulClient, prefix, advertise string, userIDer UserIDer) app.PipeRouter

NewConsulPipeRouter returns a new consul based router

func NewSQSControlRouter

func NewSQSControlRouter(config *aws.Config, userIDer UserIDer, prefix string) app.ControlRouter

NewSQSControlRouter the harbinger of death

func NoopUserIDer

func NoopUserIDer(context.Context) (string, error)

NoopUserIDer always returns the empty user ID.

Types

type CASCallback

type CASCallback func(in interface{}) (out interface{}, retry bool, err error)

CASCallback is the type of the callback to CAS. If err is nil, out must be non-nil.

type ConsulClient

type ConsulClient interface {
	Get(key string, out interface{}) error
	CAS(key string, out interface{}, f CASCallback) error
	WatchPrefix(prefix string, out interface{}, done chan struct{}, f func(string, interface{}) bool)
}

ConsulClient is a high-level client for Consul, that exposes operations such as CAS and Watch which take callbacks. It also deals with serialisation.

func NewConsulClient

func NewConsulClient(addr string) (ConsulClient, error)

NewConsulClient returns a new ConsulClient

type DynamoDBCollector

type DynamoDBCollector interface {
	app.Collector
	CreateTables() error
}

DynamoDBCollector is a Collector which can also CreateTables

func NewDynamoDBCollector

func NewDynamoDBCollector(
	userIDer UserIDer,
	dynamoDBConfig, s3Config *aws.Config,
	tableName, bucketName, natsHost string,
) (DynamoDBCollector, error)

NewDynamoDBCollector the reaper of souls https://github.com/aws/aws-sdk-go/wiki/common-examples

type UserIDer

type UserIDer func(context.Context) (string, error)

UserIDer identifies users given a request context.

func UserIDHeader

func UserIDHeader(headerName string) UserIDer

UserIDHeader returns a UserIDer which a header by the supplied key.

Jump to

Keyboard shortcuts

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