Documentation ¶
Overview ¶
Package artifact contains utilities for staging and retrieving artifacts.
Index ¶
- func Commit(ctx context.Context, client pb.ArtifactStagingServiceClient, ...) (string, error)
- func Materialize(ctx context.Context, endpoint string, dest string) ([]*pb.ArtifactMetadata, error)
- func MultiRetrieve(ctx context.Context, client pb.ArtifactRetrievalServiceClient, cpus int, ...) error
- func MultiStage(ctx context.Context, client pb.ArtifactStagingServiceClient, cpus int, ...) ([]*pb.ArtifactMetadata, error)
- func Retrieve(ctx context.Context, client pb.ArtifactRetrievalServiceClient, ...) error
- func Stage(ctx context.Context, client pb.ArtifactStagingServiceClient, ...) (*pb.ArtifactMetadata, error)
- func StageDir(ctx context.Context, client pb.ArtifactStagingServiceClient, src string) ([]*pb.ArtifactMetadata, error)
- type KeyedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commit ¶
func Commit(ctx context.Context, client pb.ArtifactStagingServiceClient, artifacts []*pb.ArtifactMetadata) (string, error)
Commit commits a manifest with the given staged artifacts. It returns the staging token, if successful.
func Materialize ¶
Materialize is a convenience helper for ensuring that all artifacts are present and uncorrupted. It interprets each artifact name as a relative path under the dest directory. It does not retrieve valid artifacts already present.
func MultiRetrieve ¶
func MultiRetrieve(ctx context.Context, client pb.ArtifactRetrievalServiceClient, cpus int, list []*pb.ArtifactMetadata, dest string) error
MultiRetrieve retrieves multiple artifacts concurrently, using at most 'cpus' goroutines. It retries each artifact a few times. Convenience wrapper.
func MultiStage ¶
func MultiStage(ctx context.Context, client pb.ArtifactStagingServiceClient, cpus int, list []KeyedFile) ([]*pb.ArtifactMetadata, error)
MultiStage stages a set of local files with the given keys. It returns the full artifact metadate. It retries each artifact a few times. Convenience wrapper.
func Retrieve ¶
func Retrieve(ctx context.Context, client pb.ArtifactRetrievalServiceClient, a *pb.ArtifactMetadata, dest string) error
Retrieve checks whether the given artifact is already successfully retrieved. If not, it retrieves into the dest directory. It overwrites any previous retrieval attempt and may leave a corrupt/partial local file on failure.
func Stage ¶
func Stage(ctx context.Context, client pb.ArtifactStagingServiceClient, key, filename string) (*pb.ArtifactMetadata, error)
Stage stages a local file as an artifact with the given key. It computes the MD5 and returns the full artifact metadata.
func StageDir ¶
func StageDir(ctx context.Context, client pb.ArtifactStagingServiceClient, src string) ([]*pb.ArtifactMetadata, error)
StageDir stages a local directory with relative path keys. Convenience wrapper.