artifact

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 7 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)

type Stage

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

func (*Stage) UnmarshalJSON added in v0.12.6

func (s *Stage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements a custom JSON unmarshal method that sets the concrete Data types for each stage type.

type StageID added in v0.12.6

type StageID string
const (
	StageIDBuild      StageID = "build"
	StageIDTest       StageID = "test"
	StageIDPush       StageID = "push"
	StageIDSnykCode   StageID = "snyk-code"
	StageIDSnykDocker StageID = "snyk-docker"
)

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