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.
Click to show internal directories.
Click to hide internal directories.