settings

package
v5.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Defaults = Service{
		Context: "default",
		Aliases: []string{},
		Location: gh.Location{
			Ref: "master",
		},
		Interceptors: Interceptors{
			PreStopSleep: PreStopSleepInterceptor{
				Options: prestopsleep.Options{
					Seconds: 3,
				},
			},
			GHStatusChecker: GHStatusCheckerInterceptor{
				Options: statuschecker.DefaultOptions,
			},
		},
	}
)

Functions

This section is empty.

Types

type Contexts

type Contexts map[string]Service

type GHStatusCheckerInterceptor

type GHStatusCheckerInterceptor struct {
	Enabled TriState              `yaml:"enabled"`
	Options statuschecker.Options `yaml:"options"`
}

type Interceptor

type Interceptor struct {
	Enabled TriState `yaml:"enabled"`
}

type Interceptors

type Interceptors struct {
	PreStopSleep        PreStopSleepInterceptor    `yaml:"preStopSleep"`
	RemoveResourceSpecs Interceptor                `yaml:"removeResourceSpecs"`
	RemoveOldJob        Interceptor                `yaml:"removeOldJob"`
	Waiter              Interceptor                `yaml:"waiter"`
	Annotater           Interceptor                `yaml:"annotater"`
	GHStatusChecker     GHStatusCheckerInterceptor `yaml:"ghStatusChecker"`
}

type PreStopSleepInterceptor

type PreStopSleepInterceptor struct {
	Enabled TriState             `yaml:"enabled"`
	Options prestopsleep.Options `yaml:"options"`
}

type Service

type Service struct {
	Name         string              `yaml:"name,omitempty"`
	Aliases      []string            `yaml:"aliases,omitempty"`
	Context      string              `yaml:"context,omitempty"`
	Location     gh.Location         `yaml:",inline,omitempty"`
	Variables    templates.Variables `yaml:"variables,omitempty"`
	Interceptors Interceptors        `yaml:"interceptors,omitempty"`
}

func (*Service) Clean

func (s *Service) Clean(defaults Service)

func (*Service) Defaults

func (s *Service) Defaults(defaults Service)

type Services

type Services []Service

func (Services) Get

func (s Services) Get(name string) *Service

type Settings

type Settings struct {
	Defaults Service  `yaml:"defaults"`
	Services Services `yaml:"services"`
	Contexts Contexts `yaml:"contexts"`
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(data []byte) (*Settings, error)

func Read

func Read(location string, client gh.Interface) (*Settings, error)

func ReadFromFile

func ReadFromFile(filename string) (*Settings, error)

func ReadFromGitHub

func ReadFromGitHub(filename string, client gh.Interface) (*Settings, error)

func (*Settings) Clean

func (s *Settings) Clean(contextName string)

func (*Settings) CurrentContext

func (s *Settings) CurrentContext() Service

func (*Settings) Service

func (s *Settings) Service(project string) *Service

type TriState

type TriState int
const (
	Unknown TriState = iota
	Disabled
	Enabled
)

func (TriState) MarshalYAML

func (ts TriState) MarshalYAML() (interface{}, error)

func (*TriState) UnmarshalYAML

func (ts *TriState) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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