model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Identifier string
	Uses       Uses
	Runs, Args Command
	Needs      []string
	Env        map[string]string
	Secrets    []string
}

Action represents a single "action" stanza in a .workflow file.

type Command

type Command interface {
	Split() []string
	// contains filtered or unexported methods
}

Command represents the optional "runs" and "args" attributes. Each one takes one of two forms:

  • runs="entrypoint arg1 arg2 ..."
  • runs=[ "entrypoint", "arg1", "arg2", ... ]

type Configuration

type Configuration struct {
	Actions   []*Action
	Workflows []*Workflow
}

Configuration is a parsed main.workflow file

func (*Configuration) GetAction

func (c *Configuration) GetAction(id string) *Action

GetAction looks up action by identifier.

If the action is not found, nil is returned.

func (*Configuration) GetWorkflow

func (c *Configuration) GetWorkflow(id string) *Workflow

GetWorkflow looks up a workflow by identifier.

If the workflow is not found, nil is returned.

func (*Configuration) GetWorkflows

func (c *Configuration) GetWorkflows(eventType string) []*Workflow

GetWorkflows gets all Workflow structures that match a given type of event. e.g., GetWorkflows("push")

type ListCommand

type ListCommand struct {
	Values []string
}

ListCommand represents the list based form of the "runs" or "args" attribute.

  • runs=[ "entrypoint", "arg1", "arg2", ... ]

func (*ListCommand) Split

func (l *ListCommand) Split() []string

type StringCommand

type StringCommand struct {
	Value string
}

StringCommand represents the string based form of the "runs" or "args" attribute.

  • runs="entrypoint arg1 arg2 ..."

func (*StringCommand) Split

func (s *StringCommand) Split() []string

type Uses

type Uses interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

type UsesDockerImage

type UsesDockerImage struct {
	Image string
}

UsesDockerImage represents `uses = "docker://<image>"`

func (*UsesDockerImage) String

func (u *UsesDockerImage) String() string

type UsesInvalid

type UsesInvalid struct {
	Raw string
}

UsesInvalid represents any invalid `uses = "<raw>"` value

func (*UsesInvalid) String

func (u *UsesInvalid) String() string

type UsesPath

type UsesPath struct {
	Path string
}

UsesPath represents `uses = "./<path>"`

func (*UsesPath) String

func (u *UsesPath) String() string

type UsesRepository

type UsesRepository struct {
	Repository string
	Path       string
	Ref        string
}

UsesRepository represents `uses = "<owner>/<repo>[/<path>]@<ref>"`

func (*UsesRepository) String

func (u *UsesRepository) String() string

type Workflow

type Workflow struct {
	Identifier string
	On         string
	Resolves   []string
}

Workflow represents a single "workflow" stanza in a .workflow file.

Jump to

Keyboard shortcuts

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