Documentation ¶
Index ¶
- Constants
- Variables
- func AppStatusNames() []string
- func LoadConfigFile(filename string) (err error)
- func ParseAppsFromArgs(args []string, runByDefault func(string) bool) (apps []string)
- func RegisterApp(logger *zap.Logger, appDef *AppDef)
- func RegisterFlags(logger *zap.Logger, cmd *cobra.Command) error
- func SetAutoMaxProcs(logger *zap.Logger)
- func SetAutoMemoryLimit(limit uint64, logger *zap.Logger) error
- func SetMaxOpenFilesLimit(logger *zap.Logger, goodEnoughMaxOpenFiles, osxStockMaxOpenFiles uint64) error
- func SetupAnalyticsMetrics(logger *zap.Logger, metricsListenAddr string, pprofListenAddr string)
- func SetupLogger(rootLogger *zap.Logger, opts *LoggingOptions)
- func SetupTracing(name string)
- type App
- type AppDef
- type AppInfo
- type AppStatus
- type CommandConfig
- type Launcher
- func (l *Launcher) Close()
- func (l *Launcher) Err() error
- func (l *Launcher) FatalAppError(app string, err error)
- func (l *Launcher) GetAppIDs() (resp []string)
- func (l *Launcher) GetAppStatus(appID string) AppStatus
- func (l *Launcher) Launch(appNames []string) error
- func (l *Launcher) StoreAndStreamAppStatus(appID string, status AppStatus)
- func (l *Launcher) SubscribeAppStatus() *subscription
- func (l *Launcher) SwitchHasBeenSignaledAtomic(other *atomic.Bool)
- func (l *Launcher) Terminating() <-chan string
- func (l *Launcher) UnsubscribeAppStatus(sub *subscription)
- func (l *Launcher) WaitForTermination()
- type LoggingOptions
- type Runtime
Constants ¶
View Source
const DefaultLogFile = "app.log.json"
Variables ¶
View Source
var AppRegistry = map[string]*AppDef{}
View Source
var Config map[string]*CommandConfig
View Source
var ErrInvalidAppStatus = fmt.Errorf("not a valid AppStatus, try [%s]", strings.Join(_AppStatusNames, ", "))
Functions ¶
func AppStatusNames ¶
func AppStatusNames() []string
AppStatusNames returns a list of possible string values of AppStatus.
func LoadConfigFile ¶
Load reads a YAML config, and sets the global DfuseConfig variable Use the raw JSON form to provide to the different plugins and apps for them to load their config.
func ParseAppsFromArgs ¶
func RegisterApp ¶
func SetAutoMaxProcs ¶
func SetMaxOpenFilesLimit ¶
func SetupAnalyticsMetrics ¶
func SetupLogger ¶
func SetupLogger(rootLogger *zap.Logger, opts *LoggingOptions)
func SetupTracing ¶
func SetupTracing(name string)
Types ¶
type AppDef ¶
type AppStatus ¶
type AppStatus uint
ENUM(
NotFound Created Running Warning Stopped
)
const ( // AppStatusNotFound is a AppStatus of type NotFound. AppStatusNotFound AppStatus = iota // AppStatusCreated is a AppStatus of type Created. AppStatusCreated // AppStatusRunning is a AppStatus of type Running. AppStatusRunning // AppStatusWarning is a AppStatus of type Warning. AppStatusWarning // AppStatusStopped is a AppStatus of type Stopped. AppStatusStopped )
func ParseAppStatus ¶
ParseAppStatus attempts to convert a string to a AppStatus.
func (AppStatus) IsValid ¶ added in v1.6.0
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AppStatus) MarshalText ¶
MarshalText implements the text marshaller method.
func (*AppStatus) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type CommandConfig ¶
type Launcher ¶
type Launcher struct {
// contains filtered or unexported fields
}
func NewLauncher ¶
func (*Launcher) FatalAppError ¶
func (*Launcher) GetAppStatus ¶
func (*Launcher) StoreAndStreamAppStatus ¶
func (*Launcher) SubscribeAppStatus ¶
func (l *Launcher) SubscribeAppStatus() *subscription
func (*Launcher) SwitchHasBeenSignaledAtomic ¶
func (*Launcher) Terminating ¶
func (*Launcher) UnsubscribeAppStatus ¶
func (l *Launcher) UnsubscribeAppStatus(sub *subscription)
func (*Launcher) WaitForTermination ¶
func (l *Launcher) WaitForTermination()
type LoggingOptions ¶
type LoggingOptions struct { WorkingDir string // the folder where the data will be stored, in our case will be used to store the logger Verbosity int // verbosity level LogFormat string // specifies the log format LogToFile bool // specifies if we should store the logs on disk LogListenAddr string // address that listens to change the logs LogToStderr bool // determines if the standard console logger should log to Stderr (defaults is to log in Stdout) }
type Runtime ¶
type Runtime struct { AbsDataDir string InfoServer *info.InfoServer // IsPendingShutdown is a function that is going to return true as soon as the initial SIGINT signal is // received which can be used to turn a healthz monitor as unhealthy so that a load balancer can // remove the node from the pool and has 'common-system-shutdown-signal-delay' to do it. IsPendingShutdown func() bool }
Click to show internal directories.
Click to hide internal directories.