luci: Index | Files

package config

import ""


Package Files

builder.go config.go emailtemplate.go project.go settings.go validate.go

func GetConfigService Uses

func GetConfigService(c context.Context) configInterface.Interface

GetConfigService returns an Interface based on the provided context values

func UpdateHandler Uses

func UpdateHandler(c *router.Context)

UpdateHandler is the HTTP router handler for handling cron-triggered configuration update requests.

func WithConfigService Uses

func WithConfigService(c context.Context, cInterface configInterface.Interface) context.Context

WithConfigService sets a luci_notify config interface to be used for all config interaction.

type Builder Uses

type Builder struct {
    // ProjectKey is a datastore key to this Builder's project. Note that this key
    // is a parent key, effectively making the Builder a child of a specific project.
    ProjectKey *datastore.Key `gae:"$parent"`

    // ID is the builder's canonical ID (e.g. <bucket>/<name>).
    ID  string `gae:"$id"`

    // Repository is the repository this builder is tracking and the repository that
    // Revision is valid for.
    Repository string

    // Notifications is Notifications proto message, containing Notification messages
    // associated with this builder. Each notification contains information about who
    // to notify, and different settings on how to notify them.
    Notifications notifypb.Notifications

    // Status is current status of the builder.
    // It is updated every time a new build has a new status and either
    //   1) the new build has a newer revision than StatusRevision, or
    //   2) the new build's revision == StatusRevision, but it has a newer
    //      creation time.
    Status buildbucketpb.Status

    // BuildTime is computed as the creation time of the most recent build encountered.
    // It can be used to decide whether Status and this Builder should be updated.
    BuildTime time.Time

    // Revision is the revision of the codebase that's associated with the most
    // recent build encountered. It can be used to decide whether Status should be
    // updated.
    Revision string

    // GitilesCommits are the gitiles commits checked out by the most recent build
    // encountered that had a non-empty checkout. It can also be used to compute a
    // blamelist.
    GitilesCommits notifypb.GitilesCommits
    // contains filtered or unexported fields

Builder represents the state of the last build seen from a particular builder in order to implement certain notification triggers (i.e. on change).

type EmailTemplate Uses

type EmailTemplate struct {
    // ProjectKey is a datastore key of the LUCI project containing this email
    // template.
    ProjectKey *datastore.Key `gae:"$parent"`

    // Name identifies the email template. It is unique within the project.
    Name string `gae:"$id"`

    // SubjectTextTemplate is a text.Template of the email subject.
    SubjectTextTemplate string `gae:",noindex"`

    // BodyHTMLTemplate is a html.Template of the email body.
    BodyHTMLTemplate string `gae:",noindex"`

    // DefinitionURL is a URL to human-viewable page that contains the definition
    // of this email template.
    DefinitionURL string `gae:",noindex"`

EmailTemplate is a Datastore entity directly under Project entity that represents an email template. It is managed by the cron job that ingests configs.

func (*EmailTemplate) Template Uses

func (t *EmailTemplate) Template() *mailtmpl.Template

Template converts t to *mailtmpl.Template.

type Project Uses

type Project struct {
    // Name is the name of the project.
    // This must be unique on this luci-notify instance.
    Name string `gae:"$id"`

    // Revision is the revision of this project's luci-notify configuration.
    Revision string

    // URL is the luci-config URL to this project's luci-notify configuration.
    URL string

Project represents the luci-notify configuration for a single project in the datastore.

type Settings Uses

type Settings struct {
    // ID is the datastore ID for service settings.
    ID  string `gae:"$id,service_config"`

    // Revision is the revision of this instance's configuration.
    Revision string

    // Settings is an embedded copy of this instance's configuration proto.
    Settings notifypb.Settings `gae:"-"`

Settings represents the luci-notify configuration for a single instance of the service.

func (*Settings) Load Uses

func (s *Settings) Load(props datastore.PropertyMap) error

Load loads a Settings's information from props.

This implements PropertyLoadSaver. Load unmarshals the property Settings stored in the datastore as a binary proto into the struct's Settings field.

func (*Settings) Save Uses

func (s *Settings) Save(withMeta bool) (datastore.PropertyMap, error)

Save saves a Settings's information to a property map.

This implements PropertyLoadSaver. Save marshals the Settings field as a binary proto and stores it in the Settings property.

Package config imports 25 packages (graph) and is imported by 2 packages. Updated 2020-01-18. Refresh now. Tools for package owners.