apiserver

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

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

func NewMetricsCollector() *apiserver.Collector

NewMetricsCollector returns a new apiserver collector

func NewWorker

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

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

Types

type Config

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

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

func (Config) Validate

func (config Config) Validate() error

Validate validates the API server configuration.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName              string
	AuthenticatorName      string
	ClockName              string
	ModelCacheName         string
	MultiwatcherName       string
	MuxName                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

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type NewServerFunc

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.

Jump to

Keyboard shortcuts

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