types

package
v0.1.0-mac Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORKSPACE = "workspaces"
	LAYOUT    = "layouts"
	JOB       = "jobs"
	VAR       = "vars"
	WATCH     = "watch"
	STATE     = "state"
)

Variables

This section is empty.

Functions

func MakeVersion

func MakeVersion() string

Types

type BaseType

type BaseType struct{}

func (*BaseType) SaveId

func (b *BaseType) SaveId(string)

type Job

type Job struct {
	Id            string `json:"id"`
	LayoutId      string `json:"layout_id"`
	LayoutVersion string `json:"layout_version"`
	Status        int32  `json:"status"`
	VarsVersion   string `json:"vars_version"`
	Op            int32  `json:"op"`
	Dry           bool   `json:"dry"`
}

func (*Job) MakePath

func (v *Job) MakePath(n *Tree) string

func (*Job) Marshal

func (w *Job) Marshal() ([]byte, error)

func (*Job) SaveId

func (v *Job) SaveId(id string)

func (*Job) Unmarshal

func (w *Job) Unmarshal(b []byte) error

type Layout

type Layout struct {
	Id     string                     `json:"id"`
	Plan   map[string]json.RawMessage `json:"plan"`
	Status int32                      `json:"status"`
	*BaseType
}

func (*Layout) MakePath

func (l *Layout) MakePath(n *Tree) string

func (*Layout) Marshal

func (w *Layout) Marshal() ([]byte, error)

func (*Layout) SaveId

func (l *Layout) SaveId(string)

func (*Layout) Unmarshal

func (w *Layout) Unmarshal(b []byte) error

type ReaderWriter

type ReaderWriter interface {
	MakePath(tree *Tree) string
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
	SaveId(string)
}

type Tree

type Tree struct {
	Name     string
	TreeType string
	Child    *Tree
}

Tree is a Hierarchical representation of a Path at which a node is expected to be found.

func MakeTree

func MakeTree(nodes ...string) *Tree

MakeTree populates a Tree based on Input. Tree in itself is quite vague (read generic), but consumption is specific to workspace and layouts. Example: MakeTRee(workspace_id) returns a tree for a Workspace whereas MakeTree(workspace_id, layout_id) returns a tree for a Workspace and a Layout{.

func (*Tree) MakePath

func (n *Tree) MakePath() string

type Vars

type Vars map[string]interface{}

func (*Vars) MakePath

func (v *Vars) MakePath(n *Tree) string

func (*Vars) Marshal

func (w *Vars) Marshal() ([]byte, error)

func (*Vars) RedactSecrets

func (w *Vars) RedactSecrets()

func (*Vars) SaveId

func (v *Vars) SaveId(id string)

func (*Vars) Unmarshal

func (w *Vars) Unmarshal(b []byte) error

type Watch

type Watch struct {
	Id         string
	SuccessURL string `json:"success_url"`
	FailureURL string `json:"failure_url"`
}

func (*Watch) MakePath

func (w *Watch) MakePath(n *Tree) string

func (*Watch) Marshal

func (w *Watch) Marshal() ([]byte, error)

func (*Watch) SaveId

func (v *Watch) SaveId(id string)

func (*Watch) Unmarshal

func (w *Watch) Unmarshal(b []byte) error

type Workspace

type Workspace string

func (*Workspace) MakePath

func (w *Workspace) MakePath(_ *Tree) string

func (*Workspace) Marshal

func (w *Workspace) Marshal() ([]byte, error)

func (*Workspace) SaveId

func (w *Workspace) SaveId(string)

func (*Workspace) Unmarshal

func (w *Workspace) Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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