config

package
v0.3.7-alpha4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinRoundDuration = time.Duration(20) * time.Second
)

Variables

View Source
var ErrRoundDurationLargerThanMinRoundDuration = errors.New("round Duration should not be larger than MinRoundDuration")

Functions

This section is empty.

Types

type DynamicConfig

type DynamicConfig struct {
	ID uint64 `json:"id,omitempty"`
	// Describes how long each round unit takes to execute in seconds. This value shuold have a minimum value enforced (something like 20 seconds)
	RoundDuration uint64 `json:"round_duration,omitempty" default:"60"`
	// Enables or disables competition globally
	Enabled *bool `json:"enabled,omitempty" default:"false" gorm:"not null;default:false"`
}

DynamicConfig model is a set of columns describing the dynamicConfig of the scoring engine

func (*DynamicConfig) BeforeSave

func (d *DynamicConfig) BeforeSave(tx *gorm.DB) (err error)

func (*DynamicConfig) IsEqual

func (d *DynamicConfig) IsEqual(dc *DynamicConfig) bool

func (DynamicConfig) TableName

func (d DynamicConfig) TableName() string

type StaticConfig

type StaticConfig struct {
	DB storage.Config
	// This value ideally shouldn't be larger than few seconds
	DatabaseMaxTimeDriftSeconds uint `default:"2"`
	// How frequently to pull dynamic configs
	DynamicConfigPullSeconds uint `default:"5"`

	Queue queueing.Config

	Platform platforming.Config

	PubSubConfig queueing.MasterConfig

	AdminUsername string `default:"admin"`

	AdminPassword string `default:"changeme"`

	Port string `default:"33333"`

	Prod bool `default:"false"`

	CertFile string `default:""`

	KeyFile string `default:""`

	JWT auth.Config
}

StaticConfig is a struct of settings that are set at the start of the application. It contains Configs from other packages defined under pkg/ directory. StaticConfig is read only at the moment, hence there is no lock / prevention to race conditions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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