artifact

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileNotFound indicates that an artifact was not found.
	ErrFileNotFound = errors.New("file not found")
	// ErrNotParsable indicates that an artifact could not be parsed against the
	// artifact specification.
	ErrNotParsable = errors.New("artifact not parsable")
	// ErrUnknownFields indicates that an artifact contains an unknown field.
	ErrUnknownFields = errors.New("artifact contains unknown fields")
)

Functions

func Encode added in v0.6.0

func Encode(spec Spec, pretty bool) (string, error)

func Persist

func Persist(path string, spec Spec) error

func Update

func Update(path string, f func(Spec) Spec) error

Types

type BuildData

type BuildData struct {
	Image         string `json:"image,omitempty"`
	Tag           string `json:"tag,omitempty"`
	DockerVersion string `json:"dockerVersion,omitempty"`
}

type CI

type CI struct {
	JobURL string    `json:"jobUrl,omitempty"`
	Start  time.Time `json:"start,omitempty"`
	End    time.Time `json:"end,omitempty"`
}

type PushData

type PushData struct {
	Image         string `json:"image,omitempty"`
	Tag           string `json:"tag,omitempty"`
	DockerVersion string `json:"dockerVersion,omitempty"`
}

type Repository

type Repository struct {
	Branch         string `json:"branch,omitempty"`
	SHA            string `json:"sha,omitempty"`
	AuthorName     string `json:"authorName,omitempty"`
	AuthorEmail    string `json:"authorEmail,omitempty"`
	CommitterName  string `json:"committerName,omitempty"`
	CommitterEmail string `json:"committerEmail,omitempty"`
	Message        string `json:"message,omitempty"`
	Name           string `json:"name,omitempty"`
	URL            string `json:"url,omitempty"`
	Provider       string `json:"provider,omitempty"`
}

type Shuttle

type Shuttle struct {
	Plan           Repository `json:"plan,omitempty"`
	ShuttleVersion string     `json:"shuttleVersion,omitempty"`
}

type SnykCodeData

type SnykCodeData struct {
	SnykVersion     string              `json:"snykVersion,omitempty"`
	URL             string              `json:"url,omitempty"`
	Language        string              `json:"language,omitempty"`
	Vulnerabilities VulnerabilityResult `json:"vulnerabilities,omitempty"`
}

type SnykDockerData

type SnykDockerData struct {
	Tag             string              `json:"tag,omitempty"`
	SnykVersion     string              `json:"snykVersion,omitempty"`
	URL             string              `json:"url,omitempty"`
	BaseImage       string              `json:"baseImage,omitempty"`
	Vulnerabilities VulnerabilityResult `json:"vulnerabilities,omitempty"`
}

type Spec

type Spec struct {
	ID          string     `json:"id,omitempty"`
	Service     string     `json:"service,omitempty"`
	Namespace   string     `json:"namespace,omitempty"`
	Application Repository `json:"application,omitempty"`
	CI          CI         `json:"ci,omitempty"`
	Squad       string     `json:"squad,omitempty"`
	Shuttle     Shuttle    `json:"shuttle,omitempty"`
	Stages      []Stage    `json:"stages,omitempty"`
}

func Decode added in v0.6.0

func Decode(reader io.Reader) (Spec, error)

func Get

func Get(path string) (Spec, error)

func (*Spec) GetStage

func (s *Spec) GetStage(stageID string) (Stage, bool)

GetStage returns a stage of the spec with provided stage ID.

type Stage

type Stage struct {
	ID   string      `json:"id,omitempty"`
	Name string      `json:"name,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

type TestData

type TestData struct {
	URL     string     `json:"url,omitempty"`
	Results TestResult `json:"results,omitempty"`
}

type TestResult

type TestResult struct {
	Passed  int `json:"passed"`
	Failed  int `json:"failed"`
	Skipped int `json:"skipped"`
}

type VulnerabilityResult

type VulnerabilityResult struct {
	High   int `json:"high"`
	Medium int `json:"medium"`
	Low    int `json:"low"`
}

Jump to

Keyboard shortcuts

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