metadata

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	AuthoredAt     time.Time
	AuthorEmail    string
	AuthorName     string
	CommittedAt    time.Time
	CommitterEmail string
	CommitterName  string
	Message        string
	SHA            string
	TreeSHA        string
}

Commit represents the metadata for a Git commit.

type CommitResolver

type CommitResolver interface {
	Lookup(sha string) (*Commit, error)
	Source() string
}

A CommitResolver provides the ability to look up a commit.

func NewRepositoryCommitResolver

func NewRepositoryCommitResolver(path string, logger logger.Logger) (CommitResolver, error)

NewRepositoryCommitResolver returns a CommitResolver for looking up commits in the repository located at path.

func NewStaticCommitResolver

func NewStaticCommitResolver(c *Commit, logger logger.Logger) CommitResolver

NewStaticCommitResolver returns a CommitResolver whose Lookup method always produces a Commit with values matching the fields in c.

type Metadata

type Metadata struct {
	AuthoredAt           time.Time `yaml:":authored_at,omitempty"`
	AuthorEmail          string    `yaml:":author_email,omitempty"`
	AuthorName           string    `yaml:":author_name,omitempty"`
	Branch               string    `yaml:":branch"`
	BuildURL             string    `yaml:":build_url"`
	Check                string    `yaml:":check"`
	CIProvider           string    `yaml:":ci_provider"`
	CommitMessage        string    `yaml:":commit_message,omitempty"`
	CommitMetadataSource string    `yaml:":commit_metadata_source"`
	CommitSHA            string    `yaml:":commit"`
	CommittedAt          time.Time `yaml:":committed_at,omitempty"`
	CommitterEmail       string    `yaml:":committer_email,omitempty"`
	CommitterName        string    `yaml:":committer_name,omitempty"`
	QuotaID              string    `yaml:":quota_id,omitempty"`
	RepoNameWithOwner    string    `yaml:":repo_name_with_owner"`
	ReporterOS           string    `yaml:":reporter_os"`
	ReporterVersion      string    `yaml:":reporter_version"`
	Tags                 []string  `yaml:":tags,omitempty"`
	Timestamp            time.Time `yaml:":timestamp"`
	TreeSHA              string    `yaml:":tree,omitempty"`
	// contains filtered or unexported fields
}

A Metadata instance provides metadata about a set of test results. It identifies the CI provider, the commit SHA, the time at which the tests were executed, etc.

func NewMetadata

func NewMetadata(version *Version, envs map[string]string, tags []string, quotaID string, resolver CommitResolver, now func() time.Time, logger logger.Logger) (*Metadata, error)

NewMetadata creates a new Metadata instance from the given args.

func (*Metadata) MarshalYAML

func (m *Metadata) MarshalYAML() (out []byte, err error)

MarshalYAML serializes the metadata into a YAML document.

type Version

type Version struct {
	Commit    string
	Number    string
	GoOS      string
	GoVersion string
}

Version represents the metadata identifying the running version of the CLI.

func (*Version) String

func (v *Version) String() string

String returns a formatted description of the CLI version, suitable for use in response to the `--version` flag.

Jump to

Keyboard shortcuts

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