common

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxJobs                      = 100
	DefaultMaxWorkers                   = 20
	DefaultTimeout                      = 20
	BaseRESTURL                         = "baseRESTURL"
	BaseRESTURLDescription              = "The REST server base URL"
	RestTimeout                         = "restTimeout"
	RestTimeoutDescription              = "Timeout for a REST API call (in seconds)"
	EnableRateLimiter                   = "enableRateLimiter"
	EnableRateLimiterDescription        = "Flag to enable rate limiter for the Echo REST server (default: true)"
	AllowedCorsOrigins                  = "allowedCorsOrigins"
	AllowedCorsOriginsDescription       = "Comma separated list of allowed CORS origins"
	EchoDebug                           = "echoDebug"
	EchoDebugDescription                = "Flag to enable debug mode in Echo REST API server (i.e., log every request to server)"
	MaxWorkers                          = "maxWorkers"
	MaxWorkersDescription               = "The maximum amount of workers running in parallel to attend job requests"
	MaxJobs                             = "maxJobs"
	MaxJobsDescription                  = "The maximum amount of jobs allowed to be queued to attend job requests"
	WsMaxConnections                    = "wsMaxConnections"
	WsMaxConnectionsDefault             = 10
	WstDefaultMaxConnectionsDescription = "The maximum number of concurrent websocket connections"
	EnableAuditing                      = "enableAuditing"
	EnableAuditingDescription           = "Flag to enable audit logs for REST API calls."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalConfig

type GlobalConfig struct {
	Traces         Traces
	RestServer     RestServer
	Worker         Worker
	Inventory      Southbound
	Websocket      Websocket
	EnableAuditing bool
}

func Config

func Config() (*GlobalConfig, error)

func DefaultConfig

func DefaultConfig() *GlobalConfig

type RestServer

type RestServer struct {
	Address           string
	BaseURL           string
	Timeout           time.Duration
	Cors              string
	EchoDebug         bool
	Authentication    bool
	EnableRateLimiter bool
	EnableMetrics     bool
	MetricsAddress    string
	OamServerAddr     string
}

type Southbound

type Southbound struct {
	Address       string
	CAPath        string
	KeyPath       string
	CertPath      string
	Retry         bool
	EnableMetrics bool
}

type Traces

type Traces struct {
	EnableTracing bool
	TraceURL      string
}

type Websocket

type Websocket struct {
	MaxConnections uint
}

type Worker

type Worker struct {
	// the number of concurrent worker.Worker
	MaxWorkers int
	// the number of worker.Job that can sit in the queue for a specific worker
	MaxJobs int
}

Jump to

Keyboard shortcuts

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