rolodex

package
v88.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(logger lager.Logger, repo TeamRepository, emitter metrics.Emitter) rolodexpb.RolodexServer

func NewTeamRepository

func NewTeamRepository(logger lager.Logger, teamsPath string) *teamRepository

Types

type Config

type Config struct {
	RepositoryPath string `yaml:"repository_path"`
	RepositoryURL  string `yaml:"repository_url"`

	GitHub struct {
		PrivateKeyPath string `yaml:"private_key_path"`
		PublicKeyPath  string `yaml:"public_key_path"`
	} `yaml:"github"`

	Metrics struct {
		SentryDSN     string `yaml:"sentry_dsn"`
		DatadogAPIKey string `yaml:"datadog_api_key"`
		Environment   string `yaml:"environment"`
	} `yaml:"metrics"`

	RPC struct {
		BindIP   string `yaml:"bind_ip"`
		BindPort uint16 `yaml:"bind_port"`

		CACertificatePath    string `yaml:"ca_certificate_path"`
		CertificatePath      string `yaml:"certificate_path"`
		PrivateKeyPath       string `yaml:"private_key_path"`
		PrivateKeyPassphrase string `yaml:"private_key_passphrase"`
	} `yaml:"rpc_server"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() []error

type GitSyncClient

type GitSyncClient interface {
	Fetch(string) (map[string][]string, error)
	Clone(string, string) error
	HardReset(string, string) error
}

type Repository

type Repository struct {
	Owner string
	Name  string
}

type SlackChannel

type SlackChannel struct {
	Team string
	Name string
}

type Syncer

type Syncer interface {
	Sync()
}

func NewSyncer

func NewSyncer(logger lager.Logger, emitter metrics.Emitter, repoURL, repoPath string, gitClient GitSyncClient, teamRepo TeamRepository) Syncer

type Team

type Team struct {
	Name         string
	SlackChannel SlackChannel
}

type TeamRecord

type TeamRecord struct {
	Name         string   `yaml:"name"`
	Repositories []string `yaml:"repositories"`

	Contact struct {
		Slack struct {
			Team    string `yaml:"team"`
			Channel string `yaml:"channel"`
		} `yaml:"slack"`
	} `yaml:"contact"`
}

func (TeamRecord) OwnsRepository

func (t TeamRecord) OwnsRepository(repo Repository) bool

type TeamRepository

type TeamRepository interface {
	GetOwners(Repository) ([]Team, error)

	Reload()
}

Directories

Path Synopsis
cmd
Code generated by counterfeiter.
Code generated by counterfeiter.
Package rolodexpb is a generated protocol buffer package.
Package rolodexpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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