Documentation
¶
Index ¶
- func GUnzippedBytes(input []byte) ([]byte, error)
- func GZippedBytes(input []byte) ([]byte, error)
- func GetArtifactMessageContents(artifact *rpc.Artifact) (proto.Message, error)
- func GetBytesForSpec(ctx context.Context, client connection.RegistryClient, spec *rpc.ApiSpec) ([]byte, error)
- func IsPrintableType(mimeType string) bool
- func PrintMessage(message proto.Message)
- func SetArtifact(ctx context.Context, client *gapic.RegistryClient, artifact *rpc.Artifact) error
- func UnzipArchiveToMap(b []byte) (map[string][]byte, error)
- func UnzipArchiveToPath(b []byte, dest string) ([]string, error)
- func VerifyLocation(ctx context.Context, client connection.RegistryClient, location string) error
- func WorkerPool(ctx context.Context, n int) (chan<- Task, func())
- func WorkerPoolWithWarnings(ctx context.Context, n int) (chan<- Task, func())
- func ZipArchiveOfFiles(files []string, prefix string, recursive bool) (buf bytes.Buffer, err error)
- func ZipArchiveOfPath(path, prefix string, recursive bool) (buf bytes.Buffer, err error)
- type Labeling
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GUnzippedBytes ¶
GUnzippedBytes uncompresses a slice of bytes.
func GZippedBytes ¶
GZippedBytes compresses a slice of bytes.
func GetArtifactMessageContents ¶ added in v0.5.8
func GetBytesForSpec ¶
func GetBytesForSpec(ctx context.Context, client connection.RegistryClient, spec *rpc.ApiSpec) ([]byte, error)
func IsPrintableType ¶ added in v0.5.9
func PrintMessage ¶
func SetArtifact ¶ added in v0.2.0
func UnzipArchiveToMap ¶ added in v0.4.5
UnzipArchiveToMap will decompress a zip archive to a map. May be memory intensive for large zip archives.
func UnzipArchiveToPath ¶
UnzipArchiveToPath will decompress a zip archive, writing all files and folders within the zip archive (parameter 1) to an output directory (parameter 2). Based on an example published at https://golangcode.com/unzip-files-in-go/
func VerifyLocation ¶ added in v0.5.7
func VerifyLocation(ctx context.Context, client connection.RegistryClient, location string) error
func WorkerPool ¶ added in v0.3.1
This function creates a waitgroup and a taskQueue for the workerPool. It will create "n" workers which will listen for Tasks on the taskQueue. It returns the taskQueue and a wait func. The clients should add new tasks to this taskQueue and call the call the wait func when done. Do not separately close the taskQueue, make use of the wait func.
func WorkerPoolWithWarnings ¶ added in v0.4.5
Similar to WorkerPool except it creates workers which log task errors as "Warnings"
func ZipArchiveOfFiles ¶ added in v0.5.7
ZipArchiveOfFiles stores a list of files in a zip archive. The specified prefix is stripped from file names in the archive.
func ZipArchiveOfPath ¶
ZipArchiveOfPath reads the contents of a path into a zip archive. The specified prefix is stripped from file names in the archive. Based on an example published at https://golangcode.com/create-zip-files-in-go/