utils

package
v0.2.4-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigCategory          = "SP CONFIG"
	LoggingCategory         = "LOGGING AND DEBUGGING"
	MetricsCategory         = "METRICS AND STATS"
	ResourceManagerCategory = "RESOURCE MANAGER"
	PerfCategory            = "PERFORMANCE TUNING"
)

Variables

View Source
var (
	ConfigFileFlag = &cli.StringFlag{
		Name:     "config",
		Category: ConfigCategory,
		Aliases:  []string{"c"},
		Usage:    "Config file path for uploading to db",
		Value:    "./config.toml",
	}
	ServerFlag = &cli.StringFlag{
		Name:     "server",
		Category: ConfigCategory,
		Aliases:  []string{"service", "svc", "s"},
		Usage:    "Services to be started list, e.g. -server gateway, uploader, receiver...",
	}

	// resource manager flags
	DisableResourceManagerFlag = &cli.BoolFlag{
		Name:     "rcmgr.disable",
		Category: ResourceManagerCategory,
		Usage:    "Disable resource manager",
	}

	// log flags
	LogLevelFlag = &cli.StringFlag{
		Name:     "log.level",
		Category: LoggingCategory,
		Usage:    "Log level",
		Value:    "info",
	}
	LogPathFlag = &cli.StringFlag{
		Name:     "log.path",
		Category: LoggingCategory,
		Usage:    "Log output file path",
		Value:    "./",
	}
	LogStdOutputFlag = &cli.BoolFlag{
		Name:     "log.std",
		Category: LoggingCategory,
		Usage:    "Log output standard io",
	}

	// Metrics flags
	MetricsDisableFlag = &cli.BoolFlag{
		Name:     "metrics.disable",
		Category: MetricsCategory,
		Usage:    "Disable metrics collection and reporting",
	}
	MetricsHTTPFlag = &cli.StringFlag{
		Name:     "metrics.addr",
		Category: MetricsCategory,
		Usage:    "Specify stand-alone metrics HTTP server listening address",
	}

	// PProf flags
	PProfDisableFlag = &cli.BoolFlag{
		Name:     "pprof.disable",
		Category: PerfCategory,
		Usage:    "Disable the pprof HTTP server",
	}
	PProfHTTPFlag = &cli.StringFlag{
		Name:     "pprof.addr",
		Category: PerfCategory,
		Usage:    "Specify pprof HTTP server listening address",
	}
)

Functions

func LoadConfig added in v0.2.2

func LoadConfig(file string, cfg *gfspconfig.GfSpConfig) error

LoadConfig loads the configuration from file.

func MakeConfig added in v0.2.2

func MakeConfig(ctx *cli.Context) (*gfspconfig.GfSpConfig, error)

MakeConfig loads the configuration from local file and replace the fields by flags.

func MakeEnv added in v0.2.2

func MakeEnv(ctx *cli.Context, cfg *gfspconfig.GfSpConfig) error

MakeEnv inits storage provider runtime environment.

func MakeGfSpClient added in v0.2.2

func MakeGfSpClient(cfg *gfspconfig.GfSpConfig) *gfspclient.GfSpClient

func MakeGnfd added in v0.2.2

func MakeGnfd(cfg *gfspconfig.GfSpConfig) (*gnfd.Gnfd, error)

func MakeSPDB

func MakeSPDB(cfg *gfspconfig.GfSpConfig) (spdb.SPDB, error)

func MergeFlags

func MergeFlags(groups ...[]cli.Flag) []cli.Flag

MergeFlags merges the given flag slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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