config

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package config contains service configuration endpoints and data definition for qscheduler-swarming.

Index

Constants

This section is empty.

Variables

View Source
var File_infra_qscheduler_service_app_config_config_proto protoreflect.FileDescriptor

Functions

func Use

Use installs a config provider into c.

Types

type Auth

type Auth struct {

	// AdminGroup is the luci-auth group controlling access to the administrative
	// endpoints of this server (the QSchedulerAdmin API).
	//
	// Members of this group also receive QSchedulerView access.
	AdminGroup string `protobuf:"bytes,1,opt,name=admin_group,json=adminGroup,proto3" json:"admin_group,omitempty"`
	// SwarmingGroup is the luci-auth group controlling access to the scheduler
	// endpoints of this server (the swarming.ExternalScheduler API).
	SwarmingGroup string `protobuf:"bytes,2,opt,name=swarming_group,json=swarmingGroup,proto3" json:"swarming_group,omitempty"`
	// ViewGroup is the luci-auth group controlloing access to the qscheduler view
	// endpoints of the server (QSchedulerView API).
	ViewGroup string `protobuf:"bytes,3,opt,name=view_group,json=viewGroup,proto3" json:"view_group,omitempty"`
	// contains filtered or unexported fields
}

func (*Auth) Descriptor deprecated

func (*Auth) Descriptor() ([]byte, []int)

Deprecated: Use Auth.ProtoReflect.Descriptor instead.

func (*Auth) GetAdminGroup

func (x *Auth) GetAdminGroup() string

func (*Auth) GetSwarmingGroup

func (x *Auth) GetSwarmingGroup() string

func (*Auth) GetViewGroup

func (x *Auth) GetViewGroup() string

func (*Auth) ProtoMessage

func (*Auth) ProtoMessage()

func (*Auth) ProtoReflect

func (x *Auth) ProtoReflect() protoreflect.Message

func (*Auth) Reset

func (x *Auth) Reset()

func (*Auth) String

func (x *Auth) String() string

type Config

type Config struct {

	// Deprecated: Do not use.
	AccessGroup string `protobuf:"bytes,1,opt,name=access_group,json=accessGroup,proto3" json:"access_group,omitempty"`
	// QuotaScheduler contains QS-specific config information.
	QuotaScheduler *QuotaScheduler `protobuf:"bytes,2,opt,name=quota_scheduler,json=quotaScheduler,proto3" json:"quota_scheduler,omitempty"`
	// Auth describes which access levels are granted to which groups.
	Auth *Auth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"`
	// contains filtered or unexported fields
}

Config is the configuration data served by luci-config for this app.

func Get

func Get(c context.Context) *Config

Get returns the config in c if it exists, or nil.

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAccessGroup deprecated

func (x *Config) GetAccessGroup() string

Deprecated: Do not use.

func (*Config) GetAuth

func (x *Config) GetAuth() *Auth

func (*Config) GetQuotaScheduler

func (x *Config) GetQuotaScheduler() *QuotaScheduler

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Loader

type Loader struct {
	ConfigPath string // path to the config file, set via -qscheduler-config
	// contains filtered or unexported fields
}

Loader periodically rereads qscheduler config file from disk and injects it into the request context.

Intended for GKE environment where the config is distributed as k8s ConfigMap object.

func (*Loader) Config

func (l *Loader) Config() *Config

Config returns last good config or nil.

func (*Loader) Load

func (l *Loader) Load() (*Config, error)

Load parses and validates the config file.

On success remembers it as a "last good config", to be used when serving requests.

func (*Loader) RegisterFlags

func (l *Loader) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers CLI flags.

func (*Loader) ReloadLoop

func (l *Loader) ReloadLoop(c context.Context)

ReloadLoop periodically reloads the config file until the context is canceled.

type Provider

type Provider func() *Config

Provider returns the current non-nil config when called.

type QuotaScheduler

type QuotaScheduler struct {

	// If specified (non-zero), this internal timeout is applied to all Notify and
	// Assign requests served by the app.
	HandlerTimeout *durationpb.Duration `protobuf:"bytes,1,opt,name=handler_timeout,json=handlerTimeout,proto3" json:"handler_timeout,omitempty"`
	// If specified, the amount of time that a batch waits to collect requests
	// before executing.
	//
	// If unspecified, defaults to 300ms.
	//
	// A higher value causes batches to be larger and hence more efficient in
	// in terms of datastore operations, but adds overhead.
	BatchConstructionWait *durationpb.Duration `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

QuotaScheduler contains configuration information for the QuotaScheduler app.

func (*QuotaScheduler) Descriptor deprecated

func (*QuotaScheduler) Descriptor() ([]byte, []int)

Deprecated: Use QuotaScheduler.ProtoReflect.Descriptor instead.

func (*QuotaScheduler) GetBatchConstructionWait

func (x *QuotaScheduler) GetBatchConstructionWait() *durationpb.Duration

func (*QuotaScheduler) GetHandlerTimeout

func (x *QuotaScheduler) GetHandlerTimeout() *durationpb.Duration

func (*QuotaScheduler) ProtoMessage

func (*QuotaScheduler) ProtoMessage()

func (*QuotaScheduler) ProtoReflect

func (x *QuotaScheduler) ProtoReflect() protoreflect.Message

func (*QuotaScheduler) Reset

func (x *QuotaScheduler) Reset()

func (*QuotaScheduler) String

func (x *QuotaScheduler) String() string

Jump to

Keyboard shortcuts

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