docker

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package docker provides a Docker label config provider for Vale.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Name    string
	Address string
	Port    int
	Labels  *mapping.Map[string, string]
}

type DockerSource

type DockerSource struct {
	// contains filtered or unexported fields
}

func NewDockerSource

func NewDockerSource(cli *client.Client) *DockerSource

func NewDockerSourceFromEnv

func NewDockerSourceFromEnv() (*DockerSource, error)

func (*DockerSource) ListContainers

func (s *DockerSource) ListContainers(ctx context.Context) (*collectionlist.List[Container], error)

func (*DockerSource) Watch

func (s *DockerSource) Watch(ctx context.Context, onReload func(), onError func(error)) (io.Closer, error)

type MemorySource

type MemorySource struct {
	// contains filtered or unexported fields
}

func NewMemorySource

func NewMemorySource(containers ...Container) *MemorySource

func (*MemorySource) ListContainers

func (s *MemorySource) ListContainers(_ context.Context) (*collectionlist.List[Container], error)

func (*MemorySource) Update

func (s *MemorySource) Update(containers ...Container)

func (*MemorySource) Watch

func (s *MemorySource) Watch(_ context.Context, onReload func(), _ func(error)) (io.Closer, error)

type Options

type Options struct {
	DefaultEntrypointName string
	DefaultEntrypointAddr string
	EntrypointAddresses   *mapping.Map[string, string]
}

func DefaultOptions

func DefaultOptions() Options

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New(name string, source Source, options Options) *Provider

func NewFromEnv

func NewFromEnv(name string, options Options) (*Provider, error)

func (*Provider) Load

func (p *Provider) Load(ctx context.Context) (*config.Config, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) SetLogger

func (p *Provider) SetLogger(logger *slog.Logger)

func (*Provider) Watch

func (p *Provider) Watch(ctx context.Context, onReload func(), onError func(error)) (io.Closer, error)

type Source

type Source interface {
	ListContainers(context.Context) (*collectionlist.List[Container], error)
	Watch(context.Context, func(), func(error)) (io.Closer, error)
}

Jump to

Keyboard shortcuts

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