archive

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package archive provides the logic for Gatecheck Bundles

Index

Constants

View Source
const BundleVersion = "1"

BundleVersion the version support by this archive format

View Source
const DefaultBundleFilename = "gatecheck-bundle.tar.gz"

DefaultBundleFilename the bundle name to be used as a default

View Source
const FileType = "Gatecheck Bundle"

FileType in plain text

View Source
const ManifestFilename = "gatecheck-manifest.json"

ManifestFilename the file name to be used as a default

Variables

This section is empty.

Functions

func TarGzipBundle added in v0.4.0

func TarGzipBundle(dst io.Writer, bundle *Bundle) (int64, error)

func UntarGzipBundle added in v0.4.0

func UntarGzipBundle(src io.Reader, bundle *Bundle) error

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

Bundle uses tar and gzip to collect reports and files into a single file

func NewBundle

func NewBundle() *Bundle

NewBundle ...

func (*Bundle) Add added in v0.4.0

func (b *Bundle) Add(content []byte, label string, tags []string)

func (*Bundle) AddFrom

func (b *Bundle) AddFrom(r io.Reader, label string, properties map[string]string) error

AddFrom reads files into the bundle

func (*Bundle) Content added in v0.4.0

func (b *Bundle) Content() string

func (*Bundle) Delete deprecated

func (b *Bundle) Delete(label string)

Delete will remove files from the bundle by label

Deprecated: use Remove

func (*Bundle) FileBytes added in v0.4.0

func (b *Bundle) FileBytes(fileLabel string) []byte

func (*Bundle) FileSize

func (b *Bundle) FileSize(fileLabel string) int

FileSize get the file size for a specific label

func (*Bundle) Manifest

func (b *Bundle) Manifest() Manifest

Manifest generated by the bundle

func (*Bundle) Remove added in v0.4.0

func (b *Bundle) Remove(label string)

Remove a file from the bundle and manifest by label

If the file doesn't exist, it will log a warning

func (*Bundle) WriteFileTo

func (b *Bundle) WriteFileTo(w io.Writer, fileLabel string) (int64, error)

WriteFileTo Used to write files inside of the bundle to a writer

type Manifest added in v0.2.0

type Manifest struct {
	Created time.Time                 `json:"createdAt"`
	Version string                    `json:"version"`
	Files   map[string]fileDescriptor `json:"files"`
}

Manifest is created and loaded into a bundle which contains information on the files

Jump to

Keyboard shortcuts

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