Documentation ¶
Overview ¶
Package plugins contains the plugin manager.
Package plugins contains the plugin manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupported is returned when a plugin capability is not supported // by any of the registered plugins. ErrUnsupported = status.Error(codes.Unimplemented, "unsupported plugin capability") )
Functions ¶
Types ¶
type BuiltinIPAM ¶ added in v0.11.0
type BuiltinIPAM struct { v1.UnimplementedIPAMPluginServer // contains filtered or unexported fields }
BuiltinIPAM is the built-in IPAM plugin that uses the mesh database to perform allocations.
func NewBuiltinIPAM ¶ added in v0.11.0
func NewBuiltinIPAM(db storage.MeshDB) *BuiltinIPAM
NewBuiltinIPAM returns a new ipam plugin with the given database.
func (*BuiltinIPAM) Allocate ¶ added in v0.11.0
func (p *BuiltinIPAM) Allocate(ctx context.Context, r *v1.AllocateIPRequest, opts ...grpc.CallOption) (*v1.AllocatedIP, error)
type IPAMConfig ¶ added in v0.11.0
type IPAMConfig struct { // StaticIPv4 is a map of node names to IPv4 addresses. StaticIPv4 map[string]any `mapstructure:"static-ipv4,omitempty" koanf:"static-ipv4,omitempty"` }
IPAMConfig contains static address assignments for nodes.
type IPAMPlugin ¶ added in v0.11.0
type IPAMPlugin interface {
Allocate(ctx context.Context, r *v1.AllocateIPRequest, opts ...grpc.CallOption) (*v1.AllocatedIP, error)
}
IPAMPlugin wraps the interface of the IPAM plugin only exposing the Allocate method. This makes for ease of use with the built-in IPAM.
type Manager ¶
type Manager interface { // Get returns the plugin with the given name. Get(name string) (clients.PluginClient, bool) // HasAuth returns true if the manager has an auth plugin. HasAuth() bool // HasWatchers returns true if the manager has any watch plugins. HasWatchers() bool // AuthUnaryInterceptor returns a unary interceptor for the configured auth plugin. // If no plugin is configured, the returned function is a pass-through. AuthUnaryInterceptor() grpc.UnaryServerInterceptor // AuthStreamInterceptor returns a stream interceptor for the configured auth plugin. // If no plugin is configured, the returned function is a pass-through. AuthStreamInterceptor() grpc.StreamServerInterceptor // AllocateIP calls the configured IPAM plugin to allocate an IP address for the given request. // If the requested version does not have a registered plugin, ErrUnsupported is returned. AllocateIP(ctx context.Context, req *v1.AllocateIPRequest) (netip.Prefix, error) // Emit emits an event to all watch plugins. Emit(ctx context.Context, ev *v1.Event) error // Close closes all plugins. Close() error }
Manager is the interface for managing plugins.
func NewManager ¶
NewManager creates a new plugin manager.
func NewManagerWithDB ¶ added in v0.10.5
NewManagerWithDB creates a new plugin manager with a storage provider and no plugins configured.
Directories ¶
Path | Synopsis |
---|---|
Package builtins contains the built-in plugin implementations.
|
Package builtins contains the built-in plugin implementations. |
basicauth
Package basicauth is an authentication plugin that uses basic auth.
|
Package basicauth is an authentication plugin that uses basic auth. |
debug
Package debug implements a plugin that exposes an HTTP server for debugging purposes.
|
Package debug implements a plugin that exposes an HTTP server for debugging purposes. |
ldap
Package ldap implements a basic LDAP authentication plugin.
|
Package ldap implements a basic LDAP authentication plugin. |
mtls
Package mtls is an authentication plugin that uses mTLS.
|
Package mtls is an authentication plugin that uses mTLS. |
Package clients contains the interface for using plugin clients.
|
Package clients contains the interface for using plugin clients. |
Package plugindb contains a SQL driver for running data queries over a Plugin Query stream.
|
Package plugindb contains a SQL driver for running data queries over a Plugin Query stream. |
Click to show internal directories.
Click to hide internal directories.