config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownAPIVersion error = errors.New("unknown api version")
	ErrUnknownKind       error = errors.New("unknown kind")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	APIVersion string         `yaml:"apiVersion"`
	Kind       string         `yaml:"kind"`
	Metadata   Metadata       `yaml:"metadata"`
	Spec       PipelineConfig `yaml:"spec"`
}

func Load

func Load(filepath string) (*Config, error)

func (*Config) IsValid

func (c *Config) IsValid() error

@todo(sje): validate the config

type Metadata

type Metadata struct {
	Name string `yaml:"name"`
}

type PipelineAction

type PipelineAction struct {
	HTTP *PipelineActionHTTP `yaml:"http,omitempty"`
}

func (PipelineAction) GetActionKey

func (a PipelineAction) GetActionKey() *string

type PipelineActionHTTP

type PipelineActionHTTP struct {
	Method string         `yaml:"method"`
	URL    string         `yaml:"url"`
	Data   map[string]any `yaml:"data"`
}

@todo(sje): might be able to use something else

type PipelineConfig

type PipelineConfig struct {
	Error    *PipelineJob      `yaml:"error,omitempty"`
	Jobs     []PipelineJob     `yaml:"jobs"`
	Port     int               `yaml:"port"`
	Stages   []string          `yaml:"stages"`
	Triggers []PipelineTrigger `yaml:"triggers"`
}

type PipelineJob

type PipelineJob struct {
	Name    string         `yaml:"name"`
	Stage   string         `yaml:"stage"`
	Action  PipelineAction `yaml:"action"`
	Timeout *time.Duration `yaml:"timeout,omitempty"`
}

type PipelineTrigger

type PipelineTrigger struct {
	Type PipelineTriggerType `yaml:"type"`
}

type PipelineTriggerType

type PipelineTriggerType string
const (
	PipelineTriggerTypeWebHook PipelineTriggerType = "webhook"
)

Jump to

Keyboard shortcuts

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