lib

package
v0.0.0-...-48fa796 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetadataPrefix is the etcd prefix where all our fs superblocks live.
	MetadataPrefix = "/fs"
	// StoragePrefix is the etcd prefix where all our fs data lives.
	StoragePrefix = "/storage"
)
View Source
const (
	// NS is the root namespace for etcd operations. All keys must use it!
	NS = "/_mgmt" // must not end with a slash!
)

Variables

This section is empty.

Functions

func CLI

func CLI(program, version string, flags Flags) error

CLI is the entry point for using mgmt normally from the CLI.

Types

type Flags

type Flags struct {
	Debug   bool // add additional log messages
	Verbose bool // add extra log message output
}

Flags are some constant flags which are used throughout the program.

type Main

type Main struct {
	Program string // the name of this program, usually set at compile time
	Version string // the version of this program, usually set at compile time

	Flags Flags // static global flags that are set at compile time

	Hostname *string // hostname to use; nil if undefined

	Prefix         *string // prefix passed in; nil if undefined
	TmpPrefix      bool    // request a pseudo-random, temporary prefix to be used
	AllowTmpPrefix bool    // allow creation of a new temporary prefix if main prefix is unavailable

	Deploy   *gapi.Deploy // deploy object including GAPI for static deploys
	DeployFs engine.Fs    // used for static deploys

	NoWatch       bool // do not change graph under any circumstances
	NoStreamWatch bool // do not update graph due to stream changes
	NoDeployWatch bool // do not change deploys after an initial deploy

	Noop                   bool   // globally force all resources into no-op mode
	Sema                   int    // add a semaphore with this lock count to each resource
	Graphviz               string // output file for graphviz data
	GraphvizFilter         string // graphviz filter to use
	ConvergedTimeout       int64  // approximately this many seconds of inactivity means we're in a converged state; -1 to disable
	ConvergedTimeoutNoExit bool   // don't exit on converged timeout
	ConvergedStatusFile    string // file to append converged status to
	MaxRuntime             uint   // exit after a maximum of approximately this many seconds

	Seeds               []string // default etc client endpoint
	ClientURLs          []string // list of URLs to listen on for client traffic
	ServerURLs          []string // list of URLs to listen on for server (peer) traffic
	AdvertiseClientURLs []string // list of URLs to advertise for client traffic
	AdvertiseServerURLs []string // list of URLs to advertise for server (peer) traffic
	IdealClusterSize    int      // ideal number of server peers in cluster; only read by initial server
	NoServer            bool     // do not let other servers peer with me
	NoNetwork           bool     // run single node instance without clustering or opening tcp ports to the outside

	NoPgp       bool    // disallow pgp functionality
	PgpKeyPath  *string // import a pre-made key pair
	PgpIdentity *string

	Prometheus       bool   // enable prometheus metrics
	PrometheusListen string // prometheus instance bind specification
	// contains filtered or unexported fields
}

Main is the main struct for running the mgmt logic.

func (*Main) Close

func (obj *Main) Close() error

Close contains a number of methods which must be run after the Run method. You must run them to properly clean up after the main program execution.

func (*Main) Exit

func (obj *Main) Exit(err error)

Exit causes a safe shutdown. This is often attached to the ^C signal handler.

func (*Main) FastExit

func (obj *Main) FastExit(err error)

FastExit causes a faster shutdown. This is often activated on the second ^C.

func (*Main) Init

func (obj *Main) Init() error

Init initializes the main struct after it performs some validation.

func (*Main) Interrupt

func (obj *Main) Interrupt(err error)

Interrupt causes the fastest shutdown. The only faster method is a kill -9 which could cause corruption. This is often activated on the third ^C. This might leave some of your resources in a partial or unknown state.

func (*Main) Run

func (obj *Main) Run() error

Run is the main execution entrypoint to run mgmt.

func (*Main) Validate

func (obj *Main) Validate() error

Validate validates the main structure without making any modifications to it.

Jump to

Keyboard shortcuts

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