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"`
Server server.Config
Prod bool `default:"false"`
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.
Click to show internal directories.
Click to hide internal directories.