luci: go.chromium.org/luci/resultdb/internal/artifacts Index | Files

package artifacts

import "go.chromium.org/luci/resultdb/internal/artifacts"

Index

Package Files

artifact.go query.go

func MustParseName Uses

func MustParseName(name string) (invID invocations.ID, testID, resultID, artifactID string)

MustParseName extracts invocation, test, result and artifactIDs. Test and result IDs are "" if this is a invocation-level artifact. Panics on failure.

func ParentID Uses

func ParentID(testID, resultID string) string

ParentID returns a value for Artifacts.ParentId Spanner column.

func ParseParentID Uses

func ParseParentID(parentID string) (testID, resultID string, err error)

ParseParentID parses parentID into testID and resultID. If the artifact's parent is invocation, then testID and resultID are "".

func Read Uses

func Read(ctx context.Context, name string) (*pb.Artifact, error)

Read reads an artifact from Spanner. If it does not exist, the returned error is annotated with NotFound GRPC code. Does not return artifact content or its location.

type Query Uses

type Query struct {
    InvocationIDs       invocations.IDSet
    ParentIDRegexp      string
    FollowEdges         *pb.ArtifactPredicate_EdgeTypeSet
    TestResultPredicate *pb.TestResultPredicate
    ContentTypesRegexp  string
    PageSize            int // must be positive
    PageToken           string
}

Query specifies artifacts to fetch.

func (*Query) Fetch Uses

func (q *Query) Fetch(ctx context.Context) (arts []*pb.Artifact, nextPageToken string, err error)

Fetch returns a page of artifacts matching q.

Returned artifacts are ordered by level (invocation or test result). Test result artifacts are sorted by parent invocation ID, test ID and artifact ID.

func (*Query) Run Uses

func (q *Query) Run(ctx context.Context, f func(*pb.Artifact) error) error

Run calls f for artifacts matching the query.

Refer to Fetch() for the ordering of returned artifacts.

Package artifacts imports 15 packages (graph) and is imported by 6 packages. Updated 2021-01-24. Refresh now. Tools for package owners.