juju: github.com/juju/juju/worker/proxyupdater Index | Files

package proxyupdater

import "github.com/juju/juju/worker/proxyupdater"

Index

Package Files

manifold.go proxyupdater.go

Variables

var NewWorker = func(config Config) (worker.Worker, error) {
    if err := config.Validate(); err != nil {
        return nil, err
    }
    envWorker := &proxyWorker{
        first:  true,
        config: config,
    }
    w, err := watcher.NewNotifyWorker(watcher.NotifyConfig{
        Handler: envWorker,
    })
    if err != nil {
        return nil, errors.Trace(err)
    }
    return w, nil
}

NewWorker returns a worker.Worker that updates proxy environment variables for the process and for the whole machine.

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a proxy updater worker, using the api connection resource named in the supplied config.

func RunWithStdIn Uses

func RunWithStdIn(input string, command string, args ...string) (string, error)

Execute the command specified with the args with optional stdin.

type API Uses

type API interface {
    ProxyConfig() (proxyupdater.ProxyConfiguration, error)
    WatchForProxyConfigAndAPIHostPortChanges() (watcher.NotifyWatcher, error)
}

API is an interface that is provided to New which can be used to fetch the API host ports

type Config Uses

type Config struct {
    SupportLegacyValues bool
    RegistryPath        string
    EnvFiles            []string
    SystemdFiles        []string
    API                 API
    ExternalUpdate      func(proxy.Settings) error
    InProcessUpdate     func(proxy.Settings) error
    RunFunc             func(string, string, ...string) (string, error)
    Logger              Logger
}

func (*Config) Validate Uses

func (c *Config) Validate() error

Validate ensures that all the required fields have values.

type Logger Uses

type Logger interface {
    Errorf(string, ...interface{})
    Warningf(string, ...interface{})
    Infof(string, ...interface{})
    Debugf(string, ...interface{})
    Tracef(string, ...interface{})
}

Logger represents the methods used for logging messages.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName           string
    APICallerName       string
    Logger              Logger
    WorkerFunc          func(Config) (worker.Worker, error)
    SupportLegacyValues bool
    ExternalUpdate      func(proxy.Settings) error
    InProcessUpdate     func(proxy.Settings) error
    RunFunc             func(string, string, ...string) (string, error)
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

Package proxyupdater imports 18 packages (graph) and is imported by 72 packages. Updated 2019-10-16. Refresh now. Tools for package owners.