artifact

package
v0.0.0-...-29e6843 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// strings for setting visibility
	Public  = "public"
	Private = "private"
	None    = "none"
)
View Source
const Collection = "artifact_files"

Variables

View Source
var (
	// BSON fields for artifact file structs
	TaskIdKey    = bsonutil.MustHaveTag(Entry{}, "TaskId")
	TaskNameKey  = bsonutil.MustHaveTag(Entry{}, "TaskDisplayName")
	BuildIdKey   = bsonutil.MustHaveTag(Entry{}, "BuildId")
	FilesKey     = bsonutil.MustHaveTag(Entry{}, "Files")
	ExecutionKey = bsonutil.MustHaveTag(Entry{}, "Execution")
	NameKey      = bsonutil.MustHaveTag(File{}, "Name")
	LinkKey      = bsonutil.MustHaveTag(File{}, "Link")
)
View Source
var ValidVisibilities = []string{Public, Private, None, ""}

Functions

func ByBuildId

func ByBuildId(id string) db.Q

ByBuildId returns all entries with the given Build Id, sorted by Task name

func ByTaskId

func ByTaskId(id string) db.Q

ByTaskId returns a query for entries with the given Task Id

func ByTaskIdAndExecution

func ByTaskIdAndExecution(id string, execution int) db.Q

ByTaskIdAndExecution returns a query for entries with the given Task Id and execution number

func ByTaskIdWithoutExecution

func ByTaskIdWithoutExecution(id string) db.Q

ByTaskIdWithoutExecution returns a query for entries with the given Task Id that do not have an execution number associated with them

func ByTaskIds

func ByTaskIds(taskIds []string) db.Q

func ByTaskIdsAndExecutions

func ByTaskIdsAndExecutions(tasks []TaskIDAndExecution) db.Q

Types

type Entry

type Entry struct {
	TaskId          string `json:"task" bson:"task"`
	TaskDisplayName string `json:"task_name" bson:"task_name"`
	BuildId         string `json:"build" bson:"build"`
	Files           []File `json:"files" bson:"files"`
	Execution       int    `json:"execution" bson:"execution"`
}

Entry stores groups of names and links (not content!) for files uploaded to the api server by a running agent. These links could be for build or task-relevant files (things like extra results, test coverage, etc.)

func FindAll

func FindAll(query db.Q) ([]Entry, error)

FindAll gets every Entry for the given query

func FindOne

func FindOne(query db.Q) (*Entry, error)

FindOne gets one Entry for the given query

func (Entry) Upsert

func (e Entry) Upsert() error

Upsert updates the files entry in the db if an entry already exists, overwriting the existing file data. If no entry exists, one is created

type File

type File struct {
	// Name is a human-readable name for the file being linked, e.g. "Coverage Report"
	Name string `json:"name" bson:"name"`
	// Link is the link to the file, e.g. "http://fileserver/coverage.html"
	Link string `json:"link" bson:"link"`
	// Visibility determines who can see the file in the UI
	Visibility string `json:"visibility" bson:"visibility"`
	// When true, these artifacts are excluded from reproduction
	IgnoreForFetch bool `bson:"fetch_ignore,omitempty" json:"ignore_for_fetch"`
}

File is a pairing of name and link for easy storage/display

type Params

type Params map[string]string

Params stores file entries as key-value pairs, for easy parameter parsing.

Key = Human-readable name for file
Value = link for the file

func (Params) Array

func (params Params) Array() []File

Array turns the parameter map into an array of File structs. Deprecated.

type TaskIDAndExecution

type TaskIDAndExecution struct {
	TaskID    string
	Execution int
}

Jump to

Keyboard shortcuts

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