service

package
v0.0.0-...-c3677c5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 82 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixOldAllocations

func FixOldAllocations(ctx context.Context, db *sql.DB, ec2 *ec2wrapper.EC2SessionManager) error

func GetLongLivedTaskNames

func GetLongLivedTaskNames() []string

func GetTaskLoopTaskNames

func GetTaskLoopTaskNames() []string

func Run

func Run(ctx context.Context, config *Config, address string) error

Types

type Config

type Config struct {
	DBURL                 string
	Key                   vpcapi.PrivateKey
	MaxConcurrentRequests int
	MaxIdleConnections    int
	MaxOpenConnections    int
	ReconcileInterval     time.Duration
	// How often to collect DB table metrics
	TableMetricsInterval time.Duration

	TLSConfig *tls.Config

	EnabledLongLivedTasks []string
	EnabledTaskLoops      []string

	TrunkNetworkInterfaceDescription  string
	BranchNetworkInterfaceDescription string
	SubnetCIDRReservationDescription  string

	WorkerRole string

	ZipkinURL string

	// The URL from where to fetch dynamic configs
	DynamicConfigURL string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(ctx context.Context, v *viper.Viper) (*Config, error)

type DynamicConfig

type DynamicConfig struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Dynamic configs have a default value, which can be overriden at runtime. These configs are periodically updated from the given dynamic config URL. Configs put here should be those that change often such as certain timeouts. Or killswitches for new features. And once those features become stable, the killswitch should be removed or moved to cmdline flags or environment variables.

func NewDynamicConfig

func NewDynamicConfig() *DynamicConfig

func (*DynamicConfig) GetBool

func (dynamicConfig *DynamicConfig) GetBool(ctx context.Context, name string, defaultValue bool) bool

func (*DynamicConfig) GetInt

func (dynamicConfig *DynamicConfig) GetInt(ctx context.Context, name string, defaultValue int) int

func (*DynamicConfig) Start

func (dynamicConfig *DynamicConfig) Start(ctx context.Context, interval time.Duration, url string)

Start fetching and updating the configs periodically

type Tags

type Tags map[string]string

func (Tags) Value

func (t Tags) Value() (driver.Value, error)

Directories

Path Synopsis
db
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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