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: 13 Imported by: 0

Documentation

Overview

Package config contains the configurations for UFS service.

Index

Constants

This section is empty.

Variables

View Source
var File_infra_unifiedfleet_app_config_config_proto protoreflect.FileDescriptor

Functions

func Use

func Use(c context.Context, cfg *Config) context.Context

Use installs a config into c.

Types

type Config

type Config struct {
	LuciConfigService      string           `protobuf:"bytes,1,opt,name=luci_config_service,json=luciConfigService,proto3" json:"luci_config_service,omitempty"`
	CrosNetworkConfig      *OSNetworkConfig `protobuf:"bytes,2,opt,name=cros_network_config,json=crosNetworkConfig,proto3" json:"cros_network_config,omitempty"`
	BucketName             string           `protobuf:"bytes,3,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"`
	MachineDbConfigService string           `` /* 131-byte string literal not displayed */
	MachineDbHost          string           `protobuf:"bytes,7,opt,name=machine_db_host,json=machineDbHost,proto3" json:"machine_db_host,omitempty"`
	CrosInventoryHost      string           `protobuf:"bytes,5,opt,name=cros_inventory_host,json=crosInventoryHost,proto3" json:"cros_inventory_host,omitempty"`
	SelfStorageBucket      string           `protobuf:"bytes,6,opt,name=self_storage_bucket,json=selfStorageBucket,proto3" json:"self_storage_bucket,omitempty"`
	Hart                   *PubSub          `protobuf:"bytes,8,opt,name=hart,proto3" json:"hart,omitempty"`
	SheetServiceAccount    string           `protobuf:"bytes,9,opt,name=sheet_service_account,json=sheetServiceAccount,proto3" json:"sheet_service_account,omitempty"`
	// The hostname of drone-queen service to push inventory to.
	QueenService string `protobuf:"bytes,10,opt,name=queen_service,json=queenService,proto3" json:"queen_service,omitempty"`
	// cron job for dronequeen push.
	EnableDronequeenPush bool `protobuf:"varint,11,opt,name=enable_dronequeen_push,json=enableDronequeenPush,proto3" json:"enable_dronequeen_push,omitempty"`
	// cron job for Inv2 to UFS sync(MachineLSE/Asset).
	DisableInv2Sync bool `protobuf:"varint,12,opt,name=disable_inv2_sync,json=disableInv2Sync,proto3" json:"disable_inv2_sync,omitempty"`
	// cron job for UFS to IV2(lab and stateconfig) BQ push.
	EnableLabStateconfigPush bool `` /* 139-byte string literal not displayed */
	// Disable use of cached ManufacturingConfig in datastore. If true,
	// GetChromeOSDeviceData will return None for ManufacturingConfig.
	//
	// Deprecated: Do not use.
	DisableCachedManufacturingConfig bool `` /* 163-byte string literal not displayed */
	// Disable use of old cached manufacturing configs from the datastore and use
	// configs cached from HWID server instead. If true, GetChromeOSDeviceData
	// will return None for ManufacturingConfig.
	UseCachedHwidManufacturingConfig bool `` /* 165-byte string literal not displayed */
	// 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) GetBucketName

func (x *Config) GetBucketName() string

func (*Config) GetCrosInventoryHost

func (x *Config) GetCrosInventoryHost() string

func (*Config) GetCrosNetworkConfig

func (x *Config) GetCrosNetworkConfig() *OSNetworkConfig

func (*Config) GetDisableCachedManufacturingConfig deprecated

func (x *Config) GetDisableCachedManufacturingConfig() bool

Deprecated: Do not use.

func (*Config) GetDisableInv2Sync

func (x *Config) GetDisableInv2Sync() bool

func (*Config) GetEnableDronequeenPush

func (x *Config) GetEnableDronequeenPush() bool

func (*Config) GetEnableLabStateconfigPush

func (x *Config) GetEnableLabStateconfigPush() bool

func (*Config) GetHart

func (x *Config) GetHart() *PubSub

func (*Config) GetLuciConfigService

func (x *Config) GetLuciConfigService() string

func (*Config) GetMachineDbConfigService

func (x *Config) GetMachineDbConfigService() string

func (*Config) GetMachineDbHost

func (x *Config) GetMachineDbHost() string

func (*Config) GetQueenService

func (x *Config) GetQueenService() string

func (*Config) GetSelfStorageBucket

func (x *Config) GetSelfStorageBucket() string

func (*Config) GetSheetServiceAccount

func (x *Config) GetSheetServiceAccount() string

func (*Config) GetUseCachedHwidManufacturingConfig

func (x *Config) GetUseCachedHwidManufacturingConfig() bool

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 -config-path
	// contains filtered or unexported fields
}

Loader periodically rereads the config file from disk (GKE) 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 loads the config from local static config file.

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 OSNetworkConfig

type OSNetworkConfig struct {
	GitilesHost         string                               `protobuf:"bytes,1,opt,name=gitiles_host,json=gitilesHost,proto3" json:"gitiles_host,omitempty"`
	Project             string                               `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	Branch              string                               `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"`
	CrosNetworkTopology []*OSNetworkConfig_OSNetworkTopology `protobuf:"bytes,4,rep,name=cros_network_topology,json=crosNetworkTopology,proto3" json:"cros_network_topology,omitempty"`
	// contains filtered or unexported fields
}

func (*OSNetworkConfig) Descriptor deprecated

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

Deprecated: Use OSNetworkConfig.ProtoReflect.Descriptor instead.

func (*OSNetworkConfig) GetBranch

func (x *OSNetworkConfig) GetBranch() string

func (*OSNetworkConfig) GetCrosNetworkTopology

func (x *OSNetworkConfig) GetCrosNetworkTopology() []*OSNetworkConfig_OSNetworkTopology

func (*OSNetworkConfig) GetGitilesHost

func (x *OSNetworkConfig) GetGitilesHost() string

func (*OSNetworkConfig) GetProject

func (x *OSNetworkConfig) GetProject() string

func (*OSNetworkConfig) ProtoMessage

func (*OSNetworkConfig) ProtoMessage()

func (*OSNetworkConfig) ProtoReflect

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

func (*OSNetworkConfig) Reset

func (x *OSNetworkConfig) Reset()

func (*OSNetworkConfig) String

func (x *OSNetworkConfig) String() string

type OSNetworkConfig_OSNetworkTopology

type OSNetworkConfig_OSNetworkTopology struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	RemotePath string `protobuf:"bytes,2,opt,name=remote_path,json=remotePath,proto3" json:"remote_path,omitempty"`
	SheetId    string `protobuf:"bytes,3,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`
	// contains filtered or unexported fields
}

func (*OSNetworkConfig_OSNetworkTopology) Descriptor deprecated

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

Deprecated: Use OSNetworkConfig_OSNetworkTopology.ProtoReflect.Descriptor instead.

func (*OSNetworkConfig_OSNetworkTopology) GetName

func (*OSNetworkConfig_OSNetworkTopology) GetRemotePath

func (x *OSNetworkConfig_OSNetworkTopology) GetRemotePath() string

func (*OSNetworkConfig_OSNetworkTopology) GetSheetId

func (x *OSNetworkConfig_OSNetworkTopology) GetSheetId() string

func (*OSNetworkConfig_OSNetworkTopology) ProtoMessage

func (*OSNetworkConfig_OSNetworkTopology) ProtoMessage()

func (*OSNetworkConfig_OSNetworkTopology) ProtoReflect

func (*OSNetworkConfig_OSNetworkTopology) Reset

func (*OSNetworkConfig_OSNetworkTopology) String

type Provider

type Provider func() *Config

Provider returns the current non-nil config when called.

type PubSub

type PubSub struct {
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	Topic   string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Batch size for batching publish requests for asset_info update. HaRT
	// services have been known to fail for batch_size > 100. Changing this
	// value might disable HaRT updates.
	BatchSize uint32 `protobuf:"varint,3,opt,name=batch_size,json=batchSize,proto3" json:"batch_size,omitempty"`
	// contains filtered or unexported fields
}

func (*PubSub) Descriptor deprecated

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

Deprecated: Use PubSub.ProtoReflect.Descriptor instead.

func (*PubSub) GetBatchSize

func (x *PubSub) GetBatchSize() uint32

func (*PubSub) GetProject

func (x *PubSub) GetProject() string

func (*PubSub) GetTopic

func (x *PubSub) GetTopic() string

func (*PubSub) ProtoMessage

func (*PubSub) ProtoMessage()

func (*PubSub) ProtoReflect

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

func (*PubSub) Reset

func (x *PubSub) Reset()

func (*PubSub) String

func (x *PubSub) String() string

Jump to

Keyboard shortcuts

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