plugin

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionPool added in v1.1.5

type ConnectionPool interface {
	// Get returns a connection from the pool
	Get() accessory.Conn

	// Put returns a connection to the pool
	Put(accessory.Conn)

	// Size returns the size of the pool
	Size() int
}

ConnectionPool provides a mechanism to get and put database connections from a pool

type DNSRegister

type DNSRegister interface {
	GetExternalAddress() (net.IP, error)
	RegisterAddress(host, user, password string, addr net.IP, offline bool) error
}

DNSRegister provides a mechanism to register DNS records to a remote dynamic DNS service

type Gateway

type Gateway interface {
	// Label returns the label of the gateway service
	Label() string

	// Description returns a description of the gateway service
	Description() string

	// Register routes for the gateway with a router
	RegisterHandlers(context.Context, Router)
}

Gateway provides a set of handlers for a router

type Log

type Log interface {
	// Print log message
	Print(context.Context, ...interface{})

	// Format and print log message
	Printf(context.Context, string, ...interface{})
}

Log plugin

type Nginx added in v1.1.1

type Nginx interface {
	// Test configuration, return error if it fails
	Test() error

	// Test the configuration and then reload it (the SIGHUP signal)
	Reload() error

	// Reopen log files (the SIGUSR1 signal)
	Reopen() error

	// Version returns the version string from nginx
	Version() string
}

Nginx provides a forked nginx instance, with the ability to reopen log files and reload the configuration

type Router

type Router interface {
	http.Handler

	// Add a host/prefix/path mapping to a handler for one or more HTTP methods
	// which match the regular expression. If the regular expression is nil,
	// then any path is matched. The methods which are supported by the
	// handler are determined are provided by the final argument. If no
	// methods are provided, then the GET method is assumed.
	AddHandler(context.Context, *regexp.Regexp, http.HandlerFunc, ...string)

	// Register a middleware handler to the router given unique name
	AddMiddleware(context.Context, func(http.HandlerFunc) http.HandlerFunc) error
}

Router is a task which maps paths to handlers

type TokenAuth added in v1.1.3

type TokenAuth interface {
	// Return true if a token associated with the name already exists
	Exists(string) bool

	// Create a new token associated with a name, duration and scopes.
	// Return the token value. The duration can be zero for no expiry.
	Create(string, time.Duration, ...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, including
	// expired tokens
	Enumerate() map[string]time.Time

	// Returns the name of the token if a value matches and is
	// valid. Updates the access time for the token. If token with value not
	// found, then return empty string
	MatchesValue(string) string

	// Returns true if the named token is valid, and one of the scopes match.
	MatchesScope(string, ...string) bool
}

TokenAuth is an interface for access to API methods through tokens

Jump to

Keyboard shortcuts

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