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

Documentation

Overview

Package config implements interface for app-level configs for cr-rev.

Index

Constants

This section is empty.

Variables

View Source
var File_infra_appengine_cr_rev_config_config_proto protoreflect.FileDescriptor

Functions

func Override

func Override(ctx context.Context, cfg *Config) error

Override sets config to desired value. Only useful for testing.

func Set

func Set(ctx context.Context) error

Set fetches the config and puts it into the datastore.

Types

type Config

type Config struct {

	// A list of hosts to index.
	Hosts []*Host `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"`
	// contains filtered or unexported fields
}

func Get

func Get(ctx context.Context) (*Config, error)

Get returns the config stored in the context.

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetHosts

func (x *Config) GetHosts() []*Host

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 Host

type Host struct {

	// The name of the host, for example "chromium" or "chrome-internal".
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Should be specified only for repositories that need to override default
	// attributes.
	Repos []*Repository `protobuf:"bytes,2,rep,name=repos,proto3" json:"repos,omitempty"`
	// Name of pubsub topic for the host which is used to update individual
	// repositories. If not present, new commits won't be indexed.
	PubsubSubscription string `protobuf:"bytes,3,opt,name=pubsub_subscription,json=pubsubSubscription,proto3" json:"pubsub_subscription,omitempty"`
	// contains filtered or unexported fields
}

func (*Host) Descriptor deprecated

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

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetName

func (x *Host) GetName() string

func (*Host) GetPubsubSubscription

func (x *Host) GetPubsubSubscription() string

func (*Host) GetRepos

func (x *Host) GetRepos() []*Repository

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

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

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

type Repository

type Repository struct {

	// The name of the repository, for example "chromium/src" or "v8/v8".
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Indexing configuration for this repository.
	//
	// Types that are assignable to Indexing:
	//	*Repository_DoNotIndex
	//	*Repository_Priority
	Indexing isRepository_Indexing `protobuf_oneof:"indexing"`
	// A list of refs to be indexed, specified as a list of ref paths. If provided
	// path is not a leaf, it will include all its children.
	//
	// Examples:
	//   # All heads
	//   "refs/heads"
	//   # All branch-heads
	//   "refs/branch-heads"
	//   # main only
	//   "refs/heads/main"
	//
	// Defaults to ["refs/heads"]
	Refs []string `protobuf:"bytes,6,rep,name=refs,proto3" json:"refs,omitempty"`
	// A list of git refs to ignore even when they match a ref included above.
	// It is also specified as a list of regular expressions automatically wrapped
	// in ^ and $.
	ExcludeRefs []string `protobuf:"bytes,7,rep,name=exclude_refs,json=excludeRefs,proto3" json:"exclude_refs,omitempty"`
	// contains filtered or unexported fields
}

func (*Repository) Descriptor deprecated

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

Deprecated: Use Repository.ProtoReflect.Descriptor instead.

func (*Repository) GetDoNotIndex

func (x *Repository) GetDoNotIndex() bool

func (*Repository) GetExcludeRefs

func (x *Repository) GetExcludeRefs() []string

func (*Repository) GetIndexing

func (m *Repository) GetIndexing() isRepository_Indexing

func (*Repository) GetName

func (x *Repository) GetName() string

func (*Repository) GetPriority

func (x *Repository) GetPriority() bool

func (*Repository) GetRefs

func (x *Repository) GetRefs() []string

func (*Repository) ProtoMessage

func (*Repository) ProtoMessage()

func (*Repository) ProtoReflect

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

func (*Repository) Reset

func (x *Repository) Reset()

func (*Repository) String

func (x *Repository) String() string

type Repository_DoNotIndex

type Repository_DoNotIndex struct {
	// Ignore commits for this repository.
	DoNotIndex bool `protobuf:"varint,2,opt,name=do_not_index,json=doNotIndex,proto3,oneof"`
}

type Repository_Priority

type Repository_Priority struct {
	// Whether git hashes that are also part of other repositories should refer
	// to this repository.
	//
	// For example, we set `priority = true` for "chromium/src", since all git
	// commit hashes in "chromium/src" will also exist in
	// "chromium/src/codesearch", but we want crrev to redirect to
	// "chromium/src" instead of "chromium/src/codesearch".
	Priority bool `protobuf:"varint,3,opt,name=priority,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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