config

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, configFile string) (context.Context, error)

NewContext loads a configuration file into the Spec struct

func OverrideConfig

func OverrideConfig(ctx context.Context, config *Spec) context.Context

OverrideConfig writes a new context with the the new configuration

Types

type BranchProtections

type BranchProtections map[string][]string

BranchProtections represents github's branch protections

type Collaborator

type Collaborator struct {
	Username   string
	Permission string
}

Collaborator represents a github collaborator

type Github

type Github struct {
	Organization  string
	Token         string
	Teams         []*Team
	Collaborators []*Collaborator
	Labels        []*Label
	Webhooks      []*Webhook
	Protections   BranchProtections
	// RemoveDefaultLabels Remove GitHub's default labels?
	RemoveDefaultLabels bool
}

Github represents the github configurations

type Label

type Label struct {
	Name  string
	Color string
}

Label represents a github label

type PullApprove

type PullApprove struct {
	Token               string
	Filename            string
	ProtectedBranchName string
}

PullApprove represents teh Pull Approve configurations

type Spec

type Spec struct {
	Github        Github
	GithubTestOrg Github
	PullApprove   PullApprove
	Zappr         Zappr
}

Spec represents the global app configuration

func WithContext

func WithContext(ctx context.Context) *Spec

WithContext returns a logrus logger from the context

type Team

type Team struct {
	ID         int
	Permission string
}

Team represents a github team

type Webhook

type Webhook struct {
	Type   string
	Config map[string]interface{}
}

Webhook represents a github webhook

type Zappr

type Zappr struct {
	URL                       string
	UseZapprGithubCredentials bool
}

Zappr represents Zappr configurations

Jump to

Keyboard shortcuts

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