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

package apiserver

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

Index

Package Files

config.go manifold.go observers.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run an apiserver worker. The manifold outputs an *apiserverhttp.Mux, for other workers to register handlers against.

func NewMetricsCollector Uses

func NewMetricsCollector() *apiserver.Collector

NewMetricsCollector returns a new apiserver collector

func NewWorker Uses

func NewWorker(config Config) (worker.Worker, error)

NewWorker returns a new API server worker, with the given configuration.

type Config Uses

type Config struct {
    AgentConfig                       agent.Config
    Clock                             clock.Clock
    Hub                               *pubsub.StructuredHub
    Presence                          presence.Recorder
    Mux                               *apiserverhttp.Mux
    Authenticator                     httpcontext.LocalMacaroonAuthenticator
    StatePool                         *state.StatePool
    Controller                        *cache.Controller
    LeaseManager                      lease.Manager
    RegisterIntrospectionHTTPHandlers func(func(path string, _ http.Handler))
    RestoreStatus                     func() state.RestoreStatus
    UpgradeComplete                   func() bool
    GetAuditConfig                    func() auditlog.Config
    NewServer                         NewServerFunc
    MetricsCollector                  *apiserver.Collector
}

Config is the configuration required for running an API server worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate validates the API server configuration.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName              string
    AuthenticatorName      string
    ClockName              string
    ModelCacheName         string
    MuxName                string
    RestoreStatusName      string
    StateName              string
    UpgradeGateName        string
    AuditConfigUpdaterName string
    LeaseManagerName       string
    RaftTransportName      string

    PrometheusRegisterer              prometheus.Registerer
    RegisterIntrospectionHTTPHandlers func(func(path string, _ http.Handler))
    Hub                               *pubsub.StructuredHub
    Presence                          presence.Recorder

    NewWorker           func(Config) (worker.Worker, error)
    NewMetricsCollector func() *apiserver.Collector
}

ManifoldConfig holds the information necessary to run an apiserver worker in a dependency.Engine.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type NewServerFunc Uses

type NewServerFunc func(apiserver.ServerConfig) (worker.Worker, error)

NewServerFunc is the type of function that will be used by the worker to create a new API server.

Package apiserver imports 25 packages (graph) and is imported by 3 packages. Updated 2019-09-20. Refresh now. Tools for package owners.