Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway interface {
Task
// Return the prefix for this gateway
Prefix() string
// Return the middleware, called from left to right, then right to left
Middleware() []string
}
Gateway provides handlers for a gateway
type Logger ¶
type Logger interface {
Task
// Log a message with arguments
Log(context.Context, ...any)
// Log a message with formatted arguments
Logf(context.Context, string, ...any)
}
Logger provides logging services
type MessageType ¶
type MessageType uint
The message type
const ( Receive MessageType = iota // A received message Send // A sent message Discovered // A service discovery message Resolved // A service was resolved into an instance )
func (MessageType) String ¶
func (v MessageType) String() string
type NetServiceTask ¶
type NetServiceTask interface {
Task
// Discover service types on all interfaces
Discover(context.Context) ([]string, error)
// Resolve service name into service instances
Resolve(context.Context, string) ([]NetService, error)
}
Network Service Task
type Nginx ¶
type Nginx interface {
Task
// Return all configurations
Enumerate() ([]NginxConfig, error)
// Create a configuration
Create(string, []byte) (NginxConfig, error)
// Revoke a configuration
Revoke(NginxConfig) error
// Enable a configuration
Enable(NginxConfig) error
// Disable a configuration
Disable(NginxConfig) error
}
Nginx provides management of configurations
type NginxConfig ¶
type NginxConfig interface {
// Return the name of the configuration
Name() string
// Return the state of the configuration
Enabled() bool
}
NginxConfig provides a configuration that can be enabled or revoked
type Router ¶
type Router interface {
Task
http.Handler
// Add a prefix/path mapping to a handler for one or more HTTP methods
AddHandler(Gateway, *regexp.Regexp, http.HandlerFunc, ...string) error
// Add middleware handler to the router given unique name
AddMiddleware(string, func(http.HandlerFunc) http.HandlerFunc) error
}
Router is a task which maps paths to routes
type TokenAuth ¶
type TokenAuth interface {
Task
// Return true if a token associated with the name already exists
Exists(string) bool
// Create a new token associated with a name and return it.
Create(string) (string, error)
// Revoke a token associated with a name. For the admin token, it is
// rotated rather than revoked.
Revoke(string) error
// Return all token names and their last access times
Enumerate() map[string]time.Time
// Returns the name of the token if a value matches. Updates
// the access time for the token. If token with value not
// found, then return empty string
Matches(string) string
}
TokenAuth stores tokens for authentication
Click to show internal directories.
Click to hide internal directories.