settings

package
v5.0.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Defaults = Service{
		Context: "default",
		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"`
	Waiter              Interceptor                `yaml:"waiter"`
	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"`
	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

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) GuessService

func (s *Settings) GuessService(name string) *Service

func (*Settings) Service

func (s *Settings) Service(name 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