apiserver

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 31 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
	RaftOpQueue                       Queue
}

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
	RaftOpQueue                       Queue

	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.

type Queue

type Queue interface {
	// Enqueue will add an operation to the queue. As this is a blocking queue, any
	// additional enqueue operations will block and wait for subsequent operations
	// to be completed.
	// The design of this is to ensure that people calling this will have to
	// correctly handle backing off from enqueueing.
	Enqueue(queue.Operation)
}

Queue is a blocking queue to guard access and to serialize raft applications, allowing for client side backoff.

Jump to

Keyboard shortcuts

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