cube

package
v0.0.0-...-e0ea099 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig is the default Cube middleware config.
	DefaultConfig = Config{
		Skipper:          middleware.DefaultSkipper,
		BatchSize:        60,
		DispatchInterval: 60,
	}
)

Functions

func Middleware

func Middleware(apiKey string) echo.MiddlewareFunc

Middleware implements Cube middleware.

func MiddlewareWithConfig

func MiddlewareWithConfig(config Config) echo.MiddlewareFunc

MiddlewareWithConfig returns a Cube middleware with config. See: `Middleware()`.

Types

type Config

type Config struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper

	// App ID
	AppID string

	// App name
	AppName string

	// LabStack API key
	APIKey string `json:"api_key"`

	// Number of requests in a batch
	BatchSize int `json:"batch_size"`

	// Interval in seconds to dispatch the batch
	DispatchInterval time.Duration `json:"dispatch_interval"`

	// TODO: To be implemented
	ClientLookup string `json:"client_lookup"`
}

Config defines the config for Cube middleware.

Jump to

Keyboard shortcuts

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