Documentation ¶
Overview ¶
Package refresher handles RefreshProjectConfigTask.
Each time it receives RefreshProjectConfigTask, it - fetches the latest project-scoped CV config for the project, - updates the stored project config if there is a config change, and - sends a config change notification to corresponding Project Manager.
Index ¶
- Variables
- func DisableProject(ctx context.Context, project string, notify NotifyCallback) error
- func UpdateProject(ctx context.Context, project string, notify NotifyCallback) error
- type NotifyCallback
- type PM
- type QM
- type RefreshProjectConfigTask
- func (*RefreshProjectConfigTask) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshProjectConfigTask) GetDisable() bool
- func (x *RefreshProjectConfigTask) GetProject() string
- func (*RefreshProjectConfigTask) ProtoMessage()
- func (x *RefreshProjectConfigTask) ProtoReflect() protoreflect.Message
- func (x *RefreshProjectConfigTask) Reset()
- func (x *RefreshProjectConfigTask) String() string
- type Refresher
Constants ¶
This section is empty.
Variables ¶
var File_go_chromium_org_luci_cv_internal_configs_prjcfg_refresher_tasks_proto protoreflect.FileDescriptor
Functions ¶
func DisableProject ¶
func DisableProject(ctx context.Context, project string, notify NotifyCallback) error
DisableProject disables the given LUCI Project if it is currently enabled.
func UpdateProject ¶
func UpdateProject(ctx context.Context, project string, notify NotifyCallback) error
UpdateProject imports the latest CV Config for a given LUCI Project from LUCI Config if the config in CV is outdated.
Types ¶
type NotifyCallback ¶
NotifyCallback is called in a transaction context from UpdateProject and DisableProject. Used by configcron package.
type PM ¶
type PM interface { Poke(ctx context.Context, luciProject string) error UpdateConfig(ctx context.Context, luciProject string) error }
PM encapsulates Project Manager notified by the ConfigRefresher.
In production, this will be prjmanager.Notifier.
type QM ¶
type QM interface {
WritePolicy(ctx context.Context, project string) (*quotapb.PolicyConfigID, error)
}
QM manages run and tryjob quotas.
type RefreshProjectConfigTask ¶
type RefreshProjectConfigTask struct { Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` Disable bool `protobuf:"varint,2,opt,name=disable,proto3" json:"disable,omitempty"` // contains filtered or unexported fields }
RefreshProjectConfigTask is used to import latest CV config for a LUCI Project from LUCI Config or disable a LUCI Project if `disable` is true.
Queue: "refresh-project-config".
func (*RefreshProjectConfigTask) Descriptor
deprecated
func (*RefreshProjectConfigTask) Descriptor() ([]byte, []int)
Deprecated: Use RefreshProjectConfigTask.ProtoReflect.Descriptor instead.
func (*RefreshProjectConfigTask) GetDisable ¶
func (x *RefreshProjectConfigTask) GetDisable() bool
func (*RefreshProjectConfigTask) GetProject ¶
func (x *RefreshProjectConfigTask) GetProject() string
func (*RefreshProjectConfigTask) ProtoMessage ¶
func (*RefreshProjectConfigTask) ProtoMessage()
func (*RefreshProjectConfigTask) ProtoReflect ¶
func (x *RefreshProjectConfigTask) ProtoReflect() protoreflect.Message
func (*RefreshProjectConfigTask) Reset ¶
func (x *RefreshProjectConfigTask) Reset()
func (*RefreshProjectConfigTask) String ¶
func (x *RefreshProjectConfigTask) String() string
type Refresher ¶
type Refresher struct {
// contains filtered or unexported fields
}
Refresher handles RefreshProjectConfigTask.
func NewRefresher ¶
NewRefresher creates a new project config Refresher and registers its TQ tasks.