plugin

package
v0.0.0-...-4685c53 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 5 Imported by: ? 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 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 NetService

type NetService interface {
	Service() string
}

Network Service

type NetServiceGateway

type NetServiceGateway interface {
	Gateway
}

Network Service Gateway

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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