npmconfig

package
v1.4.32 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ConfigEnvPath is what's used by viper to load config path
	ConfigEnvPath = "NPM_CONFIG"
)

Variables

View Source
var DefaultConfig = Config{
	ResyncPeriodInMinutes: defaultResyncPeriod,

	ListeningPort:    defaultListeningPort,
	ListeningAddress: "0.0.0.0",

	Transport: GrpcServerConfig{
		Address:     "0.0.0.0",
		Port:        defaultGrpcPort,
		ServicePort: defaultGrpcServicePort,
	},

	Toggles: Toggles{
		EnablePrometheusMetrics: true,
		EnablePprof:             true,
		EnableHTTPDebugAPI:      true,
		EnableV2NPM:             true,
		PlaceAzureChainFirst:    util.PlaceAzureChainFirst,
		ApplyIPSetsOnNeed:       false,
	},
}

DefaultConfig is the guaranteed configuration NPM can run in out of the box

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath TODO: solidify config paths

Types

type Config

type Config struct {
	ResyncPeriodInMinutes int `json:"ResyncPeriodInMinutes,omitempty"`

	ListeningPort    int    `json:"ListeningPort,omitempty"`
	ListeningAddress string `json:"ListeningAddress,omitempty"`

	Transport GrpcServerConfig `json:"Transport,omitempty"`

	Toggles Toggles `json:"Toggles,omitempty"`
}

func (Config) NPMVersion

func (c Config) NPMVersion() int

NPMVersion returns 1 if EnableV2NPM=false and 2 otherwise

type Flags

type Flags struct {
	KubeConfigPath string `json:"KubeConfigPath"`
}

type GrpcServerConfig

type GrpcServerConfig struct {
	// Address is the address on which the gRPC server will listen
	Address string `json:"Address,omitempty"`
	// Port is the port on which the gRPC server will listen
	Port int `json:"Port,omitempty"`
	// ServicePort is the service port for the client to connect to the gRPC server
	ServicePort int `json:"ServicePort,omitempty"`
}

type Toggles

type Toggles struct {
	EnablePrometheusMetrics bool
	EnablePprof             bool
	EnableHTTPDebugAPI      bool
	EnableV2NPM             bool
	PlaceAzureChainFirst    bool
	ApplyIPSetsOnNeed       bool
}

Jump to

Keyboard shortcuts

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