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

Documentation

Overview

Package config contains service configuration endpoints and data definition for lab_inventory.

Index

Constants

This section is empty.

Variables

View Source
var File_infra_appengine_cros_lab_inventory_app_config_config_proto protoreflect.FileDescriptor

Functions

func Import

func Import(c context.Context) error

Import fetches the most recent config and stores it in the datastore.

Must be called periodically to make sure Get and Middleware use the freshest config.

func Interceptor

func Interceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Interceptor is to be used to append config to context in grpc handlers.

func Middleware

func Middleware(c *router.Context, next router.Handler)

Middleware is to be used to append config to context in cron handlers.

func Use

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

Use installs cfg into c.

Types

type AdminService

type AdminService struct {

	// The skylab admin GAE server hosting the admin services.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// contains filtered or unexported fields
}

func (*AdminService) Descriptor deprecated

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

Deprecated: Use AdminService.ProtoReflect.Descriptor instead.

func (*AdminService) GetHost

func (x *AdminService) GetHost() string

func (*AdminService) ProtoMessage

func (*AdminService) ProtoMessage()

func (*AdminService) ProtoReflect

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

func (*AdminService) Reset

func (x *AdminService) Reset()

func (*AdminService) String

func (x *AdminService) String() string

type AssetTagBackfill

type AssetTagBackfill struct {
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	// Number of devices to be backfilled per hour
	Rate int32 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate,omitempty"`
	// BQ table to use for backfilling (assets_in_swarming)
	Table string `protobuf:"bytes,3,opt,name=table,proto3" json:"table,omitempty"`
	// Dataset for the said BQ table (inventory)
	Dataset string `protobuf:"bytes,4,opt,name=dataset,proto3" json:"dataset,omitempty"`
	// contains filtered or unexported fields
}

Next Tag: 5

func (*AssetTagBackfill) Descriptor deprecated

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

Deprecated: Use AssetTagBackfill.ProtoReflect.Descriptor instead.

func (*AssetTagBackfill) GetDataset

func (x *AssetTagBackfill) GetDataset() string

func (*AssetTagBackfill) GetEnable

func (x *AssetTagBackfill) GetEnable() bool

func (*AssetTagBackfill) GetRate

func (x *AssetTagBackfill) GetRate() int32

func (*AssetTagBackfill) GetTable

func (x *AssetTagBackfill) GetTable() string

func (*AssetTagBackfill) ProtoMessage

func (*AssetTagBackfill) ProtoMessage()

func (*AssetTagBackfill) ProtoReflect

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

func (*AssetTagBackfill) Reset

func (x *AssetTagBackfill) Reset()

func (*AssetTagBackfill) String

func (x *AssetTagBackfill) String() string

type Config

type Config struct {

	// AdminService contains information about the skylab admin instances.
	AdminService *AdminService `protobuf:"bytes,2,opt,name=admin_service,json=adminService,proto3" json:"admin_service,omitempty"`
	// The access groups of the inventory.
	Readers                   *LuciAuthGroup `protobuf:"bytes,3,opt,name=readers,proto3" json:"readers,omitempty"`
	StatusWriters             *LuciAuthGroup `protobuf:"bytes,4,opt,name=status_writers,json=statusWriters,proto3" json:"status_writers,omitempty"`
	SetupWriters              *LuciAuthGroup `protobuf:"bytes,5,opt,name=setup_writers,json=setupWriters,proto3" json:"setup_writers,omitempty"`
	PrivilegedWriters         *LuciAuthGroup `protobuf:"bytes,6,opt,name=privileged_writers,json=privilegedWriters,proto3" json:"privileged_writers,omitempty"`
	HwidSecret                string         `protobuf:"bytes,7,opt,name=hwid_secret,json=hwidSecret,proto3" json:"hwid_secret,omitempty"`
	DeviceConfigSource        *Gitiles       `protobuf:"bytes,8,opt,name=device_config_source,json=deviceConfigSource,proto3" json:"device_config_source,omitempty"`
	ManufacturingConfigSource *Gitiles       `` /* 138-byte string literal not displayed */
	// The git repo information of inventory v1.
	// TODO(guocb) remove this after migration.
	Inventory *InventoryV1Repo `protobuf:"bytes,12,opt,name=inventory,proto3" json:"inventory,omitempty"`
	// Environment managed by this instance of app, e.g. ENVIRONMENT_STAGING,
	// ENVIRONMENT_PROD, etc.
	Environment string `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"`
	// The hostname of drone-queen service to push inventory to.
	QueenService string `protobuf:"bytes,11,opt,name=queen_service,json=queenService,proto3" json:"queen_service,omitempty"`
	// Report the DUT utilization or not.
	EnableInventoryReporting bool `` /* 137-byte string literal not displayed */
	// HaRT PubSub Configs
	Hart                *HaRT                  `protobuf:"bytes,14,opt,name=hart,proto3" json:"hart,omitempty"`
	PubsubPushers       *LuciAuthGroup         `protobuf:"bytes,15,opt,name=pubsub_pushers,json=pubsubPushers,proto3" json:"pubsub_pushers,omitempty"`
	ProjectConfigSource *ProjectConfigLocation `protobuf:"bytes,16,opt,name=project_config_source,json=projectConfigSource,proto3" json:"project_config_source,omitempty"`
	// Asset tag backfilling configuration
	BackfillingConfig *AssetTagBackfill `protobuf:"bytes,17,opt,name=backfilling_config,json=backfillingConfig,proto3" json:"backfilling_config,omitempty"`
	// UFS service endpoint
	UfsService string `protobuf:"bytes,18,opt,name=ufs_service,json=ufsService,proto3" json:"ufs_service,omitempty"`
	// UFS routing control
	Routing *UfsRouting `protobuf:"bytes,19,opt,name=routing,proto3" json:"routing,omitempty"`
	// contains filtered or unexported fields
}

Config is the configuration data served by luci-config for this app. Next tag: 20

func Get

func Get(c context.Context) *Config

Get returns the config in c, or panics. See also Use and Middleware.

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAdminService

func (x *Config) GetAdminService() *AdminService

func (*Config) GetBackfillingConfig

func (x *Config) GetBackfillingConfig() *AssetTagBackfill

func (*Config) GetDeviceConfigSource

func (x *Config) GetDeviceConfigSource() *Gitiles

func (*Config) GetEnableInventoryReporting

func (x *Config) GetEnableInventoryReporting() bool

func (*Config) GetEnvironment

func (x *Config) GetEnvironment() string

func (*Config) GetHart

func (x *Config) GetHart() *HaRT

func (*Config) GetHwidSecret

func (x *Config) GetHwidSecret() string

func (*Config) GetInventory

func (x *Config) GetInventory() *InventoryV1Repo

func (*Config) GetManufacturingConfigSource

func (x *Config) GetManufacturingConfigSource() *Gitiles

func (*Config) GetPrivilegedWriters

func (x *Config) GetPrivilegedWriters() *LuciAuthGroup

func (*Config) GetProjectConfigSource

func (x *Config) GetProjectConfigSource() *ProjectConfigLocation

func (*Config) GetPubsubPushers

func (x *Config) GetPubsubPushers() *LuciAuthGroup

func (*Config) GetQueenService

func (x *Config) GetQueenService() string

func (*Config) GetReaders

func (x *Config) GetReaders() *LuciAuthGroup

func (*Config) GetRouting

func (x *Config) GetRouting() *UfsRouting

func (*Config) GetSetupWriters

func (x *Config) GetSetupWriters() *LuciAuthGroup

func (*Config) GetStatusWriters

func (x *Config) GetStatusWriters() *LuciAuthGroup

func (*Config) GetUfsService

func (x *Config) GetUfsService() string

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 Gitiles

type Gitiles struct {

	// The gitiles host name, e.g. 'chrome-internal.googlesource.com'.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// The project (repo) name, e.g. 'chromeos/infra/config'.
	Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// The commit hash/branch to be checked out, e.g. 'refs/heads/master'.
	Committish string `protobuf:"bytes,3,opt,name=committish,proto3" json:"committish,omitempty"`
	// The path of the file to be downloaded, e.g. 'path/to/file.cfg'.
	Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*Gitiles) Descriptor deprecated

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

Deprecated: Use Gitiles.ProtoReflect.Descriptor instead.

func (*Gitiles) GetCommittish

func (x *Gitiles) GetCommittish() string

func (*Gitiles) GetHost

func (x *Gitiles) GetHost() string

func (*Gitiles) GetPath

func (x *Gitiles) GetPath() string

func (*Gitiles) GetProject

func (x *Gitiles) GetProject() string

func (*Gitiles) ProtoMessage

func (*Gitiles) ProtoMessage()

func (*Gitiles) ProtoReflect

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

func (*Gitiles) Reset

func (x *Gitiles) Reset()

func (*Gitiles) String

func (x *Gitiles) String() string

type HaRT

type HaRT 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"`
	Subscription string `protobuf:"bytes,3,opt,name=subscription,proto3" json:"subscription,omitempty"`
	// contains filtered or unexported fields
}

func (*HaRT) Descriptor deprecated

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

Deprecated: Use HaRT.ProtoReflect.Descriptor instead.

func (*HaRT) GetProject

func (x *HaRT) GetProject() string

func (*HaRT) GetSubscription

func (x *HaRT) GetSubscription() string

func (*HaRT) GetTopic

func (x *HaRT) GetTopic() string

func (*HaRT) ProtoMessage

func (*HaRT) ProtoMessage()

func (*HaRT) ProtoReflect

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

func (*HaRT) Reset

func (x *HaRT) Reset()

func (*HaRT) String

func (x *HaRT) String() string

type InventoryV1Repo

type InventoryV1Repo struct {
	Host                   string `protobuf:"bytes,1,opt,name=host,proto3" json:"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"`
	LabDataPath            string `protobuf:"bytes,4,opt,name=lab_data_path,json=labDataPath,proto3" json:"lab_data_path,omitempty"`
	InfrastructureDataPath string `` /* 129-byte string literal not displayed */
	Multifile              bool   `protobuf:"varint,6,opt,name=multifile,proto3" json:"multifile,omitempty"`
	// contains filtered or unexported fields
}

func (*InventoryV1Repo) Descriptor deprecated

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

Deprecated: Use InventoryV1Repo.ProtoReflect.Descriptor instead.

func (*InventoryV1Repo) GetBranch

func (x *InventoryV1Repo) GetBranch() string

func (*InventoryV1Repo) GetHost

func (x *InventoryV1Repo) GetHost() string

func (*InventoryV1Repo) GetInfrastructureDataPath

func (x *InventoryV1Repo) GetInfrastructureDataPath() string

func (*InventoryV1Repo) GetLabDataPath

func (x *InventoryV1Repo) GetLabDataPath() string

func (*InventoryV1Repo) GetMultifile

func (x *InventoryV1Repo) GetMultifile() bool

func (*InventoryV1Repo) GetProject

func (x *InventoryV1Repo) GetProject() string

func (*InventoryV1Repo) ProtoMessage

func (*InventoryV1Repo) ProtoMessage()

func (*InventoryV1Repo) ProtoReflect

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

func (*InventoryV1Repo) Reset

func (x *InventoryV1Repo) Reset()

func (*InventoryV1Repo) String

func (x *InventoryV1Repo) String() string

type LuciAuthGroup

type LuciAuthGroup struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*LuciAuthGroup) Descriptor deprecated

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

Deprecated: Use LuciAuthGroup.ProtoReflect.Descriptor instead.

func (*LuciAuthGroup) GetValue

func (x *LuciAuthGroup) GetValue() string

func (*LuciAuthGroup) ProtoMessage

func (*LuciAuthGroup) ProtoMessage()

func (*LuciAuthGroup) ProtoReflect

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

func (*LuciAuthGroup) Reset

func (x *LuciAuthGroup) Reset()

func (*LuciAuthGroup) String

func (x *LuciAuthGroup) String() string

type ProjectConfigLocation

type ProjectConfigLocation struct {

	// The gs bucket path for program configs in DLM.
	ProgramConfigsGsPath string `protobuf:"bytes,1,opt,name=program_configs_gs_path,json=programConfigsGsPath,proto3" json:"program_configs_gs_path,omitempty"`
	// The gitiles host for the actual device project configs, e.g. 'chrome-internal.googlesource.com'.
	GitilesHost string `protobuf:"bytes,2,opt,name=gitiles_host,json=gitilesHost,proto3" json:"gitiles_host,omitempty"`
	// The project name for any device project, e.g. "chromeos/programs/galaxy"
	Project string `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"`
	// The branch to get the config file, e.g. "master"
	Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"`
	// Indicate if new project configs are fully enabled.
	EnableProjectConfig bool `protobuf:"varint,5,opt,name=enable_project_config,json=enableProjectConfig,proto3" json:"enable_project_config,omitempty"`
	// The joined config jsonproto path, e.g. "generated/configs.jsonproto".
	JoinedConfigPath string `protobuf:"bytes,6,opt,name=joined_config_path,json=joinedConfigPath,proto3" json:"joined_config_path,omitempty"`
	// contains filtered or unexported fields
}

Next tag: 6

func (*ProjectConfigLocation) Descriptor deprecated

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

Deprecated: Use ProjectConfigLocation.ProtoReflect.Descriptor instead.

func (*ProjectConfigLocation) GetBranch

func (x *ProjectConfigLocation) GetBranch() string

func (*ProjectConfigLocation) GetEnableProjectConfig

func (x *ProjectConfigLocation) GetEnableProjectConfig() bool

func (*ProjectConfigLocation) GetGitilesHost

func (x *ProjectConfigLocation) GetGitilesHost() string

func (*ProjectConfigLocation) GetJoinedConfigPath

func (x *ProjectConfigLocation) GetJoinedConfigPath() string

func (*ProjectConfigLocation) GetProgramConfigsGsPath

func (x *ProjectConfigLocation) GetProgramConfigsGsPath() string

func (*ProjectConfigLocation) GetProject

func (x *ProjectConfigLocation) GetProject() string

func (*ProjectConfigLocation) ProtoMessage

func (*ProjectConfigLocation) ProtoMessage()

func (*ProjectConfigLocation) ProtoReflect

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

func (*ProjectConfigLocation) Reset

func (x *ProjectConfigLocation) Reset()

func (*ProjectConfigLocation) String

func (x *ProjectConfigLocation) String() string

type UfsRouting

type UfsRouting struct {

	// Deivce API flags.
	AddCrosDevices         bool `protobuf:"varint,1,opt,name=add_cros_devices,json=addCrosDevices,proto3" json:"add_cros_devices,omitempty"`
	GetCrosDevices         bool `protobuf:"varint,2,opt,name=get_cros_devices,json=getCrosDevices,proto3" json:"get_cros_devices,omitempty"`
	UpdateDutsStatus       bool `protobuf:"varint,3,opt,name=update_duts_status,json=updateDutsStatus,proto3" json:"update_duts_status,omitempty"`
	UpdateCrosDevicesSetup bool `` /* 132-byte string literal not displayed */
	UpdateLabstations      bool `protobuf:"varint,5,opt,name=update_labstations,json=updateLabstations,proto3" json:"update_labstations,omitempty"`
	DeleteCrosDevices      bool `protobuf:"varint,6,opt,name=delete_cros_devices,json=deleteCrosDevices,proto3" json:"delete_cros_devices,omitempty"`
	BatchUpdateDevices     bool `protobuf:"varint,7,opt,name=batch_update_devices,json=batchUpdateDevices,proto3" json:"batch_update_devices,omitempty"`
	// Asset API flags.
	AddAssets    bool `protobuf:"varint,8,opt,name=add_assets,json=addAssets,proto3" json:"add_assets,omitempty"`
	GetAssets    bool `protobuf:"varint,9,opt,name=get_assets,json=getAssets,proto3" json:"get_assets,omitempty"`
	DeleteAssets bool `protobuf:"varint,10,opt,name=delete_assets,json=deleteAssets,proto3" json:"delete_assets,omitempty"`
	UpdateAssets bool `protobuf:"varint,11,opt,name=update_assets,json=updateAssets,proto3" json:"update_assets,omitempty"`
	// cron job for dronequeen push.
	DisableDronequeenPush bool `` /* 128-byte string literal not displayed */
	// cron job for BQ Device/Dutstate dump.
	DumpDevicesBq bool `protobuf:"varint,13,opt,name=dump_devices_bq,json=dumpDevicesBq,proto3" json:"dump_devices_bq,omitempty"`
	// crons job for BQ Asset and AssetInfo dump.
	DumpAssetsBq bool `protobuf:"varint,14,opt,name=dump_assets_bq,json=dumpAssetsBq,proto3" json:"dump_assets_bq,omitempty"`
	// contains filtered or unexported fields
}

Flags to control API routing to UFS.

func (*UfsRouting) Descriptor deprecated

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

Deprecated: Use UfsRouting.ProtoReflect.Descriptor instead.

func (*UfsRouting) GetAddAssets

func (x *UfsRouting) GetAddAssets() bool

func (*UfsRouting) GetAddCrosDevices

func (x *UfsRouting) GetAddCrosDevices() bool

func (*UfsRouting) GetBatchUpdateDevices

func (x *UfsRouting) GetBatchUpdateDevices() bool

func (*UfsRouting) GetDeleteAssets

func (x *UfsRouting) GetDeleteAssets() bool

func (*UfsRouting) GetDeleteCrosDevices

func (x *UfsRouting) GetDeleteCrosDevices() bool

func (*UfsRouting) GetDisableDronequeenPush

func (x *UfsRouting) GetDisableDronequeenPush() bool

func (*UfsRouting) GetDumpAssetsBq

func (x *UfsRouting) GetDumpAssetsBq() bool

func (*UfsRouting) GetDumpDevicesBq

func (x *UfsRouting) GetDumpDevicesBq() bool

func (*UfsRouting) GetGetAssets

func (x *UfsRouting) GetGetAssets() bool

func (*UfsRouting) GetGetCrosDevices

func (x *UfsRouting) GetGetCrosDevices() bool

func (*UfsRouting) GetUpdateAssets

func (x *UfsRouting) GetUpdateAssets() bool

func (*UfsRouting) GetUpdateCrosDevicesSetup

func (x *UfsRouting) GetUpdateCrosDevicesSetup() bool

func (*UfsRouting) GetUpdateDutsStatus

func (x *UfsRouting) GetUpdateDutsStatus() bool

func (*UfsRouting) GetUpdateLabstations

func (x *UfsRouting) GetUpdateLabstations() bool

func (*UfsRouting) ProtoMessage

func (*UfsRouting) ProtoMessage()

func (*UfsRouting) ProtoReflect

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

func (*UfsRouting) Reset

func (x *UfsRouting) Reset()

func (*UfsRouting) String

func (x *UfsRouting) String() string

Jump to

Keyboard shortcuts

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