mserver

package
v0.0.0-...-5f133c6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(bf *client.BaseFlags) *cobra.Command

Types

type ControlPlane

type ControlPlane struct {
	Controller *Controller
	*config.Common
	// contains filtered or unexported fields
}

func New

func New(mods ...Modifier) (*ControlPlane, error)

func (*ControlPlane) MachinistCommon

func (s *ControlPlane) MachinistCommon() *config.Common

func (*ControlPlane) Run

func (s *ControlPlane) Run() error

func (*ControlPlane) Stop

func (s *ControlPlane) Stop() error

type Controller

type Controller struct {
	Log logger.Logger

	State *state.MachineController
	// contains filtered or unexported fields
}

func NewController

func NewController(mods ...ControllerModifier) (*Controller, error)

func (*Controller) Download

func (*Controller) HandlePing

func (en *Controller) HandlePing(stream mpb.Controller_PollServer, ping *mpb.ClientPing) error

func (*Controller) HandleRegister

func (en *Controller) HandleRegister(stream mpb.Controller_PollServer, ping *mpb.ClientRegister) error

func (*Controller) Init

func (en *Controller) Init()

Init is designed to run after all components have been started up before running itself as a server

func (*Controller) MetricsTargets

func (en *Controller) MetricsTargets(w http.ResponseWriter, r *http.Request)

MetricsTargets is an HTTP handler that satisfies https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config.

func (*Controller) Nodes

func (en *Controller) Nodes() []*state.Machine

func (*Controller) Poll

func (en *Controller) Poll(stream mpb.Controller_PollServer) error

func (*Controller) ServeAllAndInfoRecords

func (en *Controller) ServeAllAndInfoRecords(killChannel chan struct{}, killChannelAck chan struct{})

ServeAllAndInfoRecords will continuously poll Nodes() and create multiple _all.<domain> records containing the ip addresses of all machines attached. It also serves the current state of the dns server via the _info record. TODO(adam): be able to pass in a wrapped ticker for testing intervals

func (*Controller) Upload

func (*Controller) WriteState

func (en *Controller) WriteState()

WriteState writes state to the specified state file every 2 seconds. Will not exit or error out unless no statefile is provided.

type ControllerModifier

type ControllerModifier func(*Controller) error

func WithAllRecordsRefreshRate

func WithAllRecordsRefreshRate(duration string) ControllerModifier

func WithKDnsFlags

func WithKDnsFlags(mods ...kdns.DNSModifier) ControllerModifier

func WithStateFile

func WithStateFile(filepath string) ControllerModifier

func WithStateWriteDuration

func WithStateWriteDuration(duration string) ControllerModifier

type Modifier

type Modifier func(s *ControlPlane) error

func WithController

func WithController(controller *Controller) Modifier

func WithMachinistFlags

func WithMachinistFlags(mods ...config.CommonModifier) Modifier

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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