plugin

package
v27.3.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, c CreateClient, name string, opts ...CreateOpt) error

Create creates a new plugin with the specified name

func CreateInRegistry

func CreateInRegistry(ctx context.Context, repo string, auth *registry.AuthConfig, opts ...CreateOpt) error

CreateInRegistry makes a plugin (locally) and pushes it to a registry. This does not use a dockerd instance to create or push the plugin. If you just want to create a plugin in some daemon, use `Create`.

This can be useful when testing plugins on swarm where you don't really want the plugin to exist on any of the daemons (immediately) and there needs to be some way to distribute the plugin.

Types

type Config

type Config struct {
	*types.PluginConfig

	RegistryConfig registrypkg.ServiceOptions
	// contains filtered or unexported fields
}

Config wraps types.PluginConfig to provide some extra state for options extra customizations on the plugin details, such as using a custom binary to create the plugin with.

type CreateClient

type CreateClient interface {
	PluginCreate(context.Context, io.Reader, types.PluginCreateOptions) error
}

CreateClient is the interface used for `BuildPlugin` to interact with the daemon.

type CreateOpt

type CreateOpt func(*Config)

CreateOpt is passed used to change the default plugin config before creating it

func WithBinary

func WithBinary(bin string) CreateOpt

WithBinary is a CreateOpt to set an custom binary to create the plugin with. This binary must be statically compiled.

func WithInsecureRegistry

func WithInsecureRegistry(url string) CreateOpt

WithInsecureRegistry specifies that the given registry can skip host-key checking as well as fall back to plain http

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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