jsonconfig

package
v0.0.0-...-3015c2b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultECRRegion   = "us-east-1"
	DefaultGCRHostname = "gcr.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildTask

type BuildTask struct {
	Extends             string          `json:"extends"`
	Environment         json.RawMessage `json:"environment"`
	RequiredEnvironment []string        `json:"required-environment"`
	Dockerfile          string          `json:"dockerfile"`
	Target              string          `json:"target"`
	Tags                json.RawMessage `json:"tags"`
	Labels              json.RawMessage `json:"labels"`
}

func (*BuildTask) Translate

func (t *BuildTask) Translate(name string) (config.Task, error)

type Config

type Config struct {
	Extends          json.RawMessage            `json:"extends"`
	Options          *Options                   `json:"options"`
	Registries       []json.RawMessage          `json:"registries"`
	Workspace        string                     `json:"workspace"`
	Environment      json.RawMessage            `json:"environment"`
	EnvironmentFiles json.RawMessage            `json:"env-file"`
	Import           *ImportFileList            `json:"import"`
	Export           *ExportFileList            `json:"export"`
	Tasks            map[string]json.RawMessage `json:"tasks"`
	Plans            map[string]*Plan           `json:"plans"`
	Metaplans        map[string][]string        `json:"metaplans"`
}

func (*Config) Translate

func (c *Config) Translate(parent *config.Config) (*config.Config, error)

type ECRRegistry

type ECRRegistry struct {
	AccessKeyID     string `json:"access-key-id"`
	SecretAccessKey string `json:"secret-access-key"`
	AccountID       string `json:"account-id"`
	Region          string `json:"region"`
	Role            string `json:"role"`
}

func (*ECRRegistry) Translate

func (r *ECRRegistry) Translate() config.Registry

type ExportFileList

type ExportFileList struct {
	Files         json.RawMessage `json:"files"`
	Excludes      json.RawMessage `json:"excludes"`
	CleanExcludes json.RawMessage `json:"clean-excludes"`
}

func (*ExportFileList) Translate

func (l *ExportFileList) Translate() (*config.ExportFileList, error)

type GCRRegistry

type GCRRegistry struct {
	Hostname string `json:"hostname"`
	Key      string `json:"key"`
	KeyFile  string `json:"key-file"`
}

func (*GCRRegistry) Translate

func (r *GCRRegistry) Translate() config.Registry

type Healthcheck

type Healthcheck struct {
	Command     string        `json:"command"`
	Interval    util.Duration `json:"interval"`
	Retries     int           `json:"retries"`
	StartPeriod util.Duration `json:"start-period"`
	Timeout     util.Duration `json:"timeout"`
}

func (*Healthcheck) Translate

func (h *Healthcheck) Translate() (*config.Healthcheck, error)

type ImportFileList

type ImportFileList struct {
	Files    json.RawMessage `json:"files"`
	Excludes json.RawMessage `json:"excludes"`
}

func (*ImportFileList) Translate

func (l *ImportFileList) Translate() (*config.ImportFileList, error)

type Options

type Options struct {
	SSHIdentities       json.RawMessage   `json:"ssh-identities"`
	ForceSequential     bool              `json:"force-sequential"`
	HealthcheckInterval util.Duration     `json:"healthcheck-interval"`
	PathSubstitutions   map[string]string `json:"path-substitutions"`
}

func (*Options) Translate

func (c *Options) Translate() (*config.Options, error)

type Override

type Override struct {
	Options          *Options          `json:"options"`
	Registries       []json.RawMessage `json:"registries"`
	Environment      json.RawMessage   `json:"environment"`
	EnvironmentFiles json.RawMessage   `json:"env-file"`
	Import           *ImportFileList   `json:"import"`
	Export           *ExportFileList   `json:"export"`
}

func (*Override) Translate

func (o *Override) Translate() (*config.Override, error)

type Plan

type Plan struct {
	Extends     string          `json:"extends"`
	Disabled    string          `json:"disabled"`
	Stages      []*Stage        `json:"stages"`
	Environment json.RawMessage `json:"environment"`
}

func (*Plan) Translate

func (p *Plan) Translate(name string) (*config.Plan, error)

type PlanTask

type PlanTask struct {
	Extends             string          `json:"extends"`
	Environment         json.RawMessage `json:"environment"`
	RequiredEnvironment []string        `json:"required-environment"`
	Name                string          `json:"name"`
}

func (*PlanTask) Translate

func (t *PlanTask) Translate(name string) (config.Task, error)

type PushTask

type PushTask struct {
	Extends             string          `json:"extends"`
	Environment         json.RawMessage `json:"environment"`
	RequiredEnvironment []string        `json:"required-environment"`
	Images              json.RawMessage `json:"images"`
	IncludeBuilt        bool            `json:"include-built"`
}

func (*PushTask) Translate

func (t *PushTask) Translate(name string) (config.Task, error)

type Registry

type Registry interface {
	Translate() config.Registry
}

type RegistryTypeHint

type RegistryTypeHint struct {
	Type string `json:"type"`
}

type RemoveTask

type RemoveTask struct {
	Extends             string          `json:"extends"`
	Environment         json.RawMessage `json:"environment"`
	RequiredEnvironment []string        `json:"required-environment"`
	Images              json.RawMessage `json:"images"`
	IncludeBuilt        bool            `json:"include-built"`
}

func (*RemoveTask) Translate

func (t *RemoveTask) Translate(name string) (config.Task, error)

type RunTask

type RunTask struct {
	Extends                string          `json:"extends"`
	Environment            json.RawMessage `json:"environment"`
	RequiredEnvironment    []string        `json:"required-environment"`
	Image                  string          `json:"image"`
	Command                string          `json:"command"`
	Shell                  string          `json:"shell"`
	Script                 string          `json:"script"`
	Entrypoint             string          `json:"entrypoint"`
	User                   string          `json:"user"`
	Workspace              string          `json:"workspace"`
	Hostname               string          `json:"hostname"`
	Detach                 bool            `json:"detach"`
	Healthcheck            *Healthcheck    `json:"healthcheck"`
	ExportEnvironmentFiles json.RawMessage `json:"export-environment-file"`
}

func (*RunTask) Translate

func (t *RunTask) Translate(name string) (config.Task, error)

type ServerRegistry

type ServerRegistry struct {
	Server       string `json:"server"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	PasswordFile string `json:"password-file"`
}

func (*ServerRegistry) Translate

func (r *ServerRegistry) Translate() config.Registry

type Stage

type Stage struct {
	Name        string            `json:"name"`
	Disabled    string            `json:"disabled"`
	BeforeStage string            `json:"before-stage"`
	AfterStage  string            `json:"after-stage"`
	Tasks       []json.RawMessage `json:"tasks"`
	RunMode     string            `json:"run-mode"`
	Parallel    bool              `json:"parallel"`
	Environment json.RawMessage   `json:"environment"`
}

func (*Stage) Translate

func (s *Stage) Translate() (*config.Stage, error)

type StageTask

type StageTask struct {
	Name        string          `json:"name"`
	Disabled    string          `json:"disabled"`
	Environment json.RawMessage `json:"environment"`
}

type Task

type Task interface {
	Translate(name string) (config.Task, error)
}

type TaskExtendHint

type TaskExtendHint struct {
	Extend string `json:"extends"`
}

type TaskTypeHint

type TaskTypeHint struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳