archive

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func GetURL

func GetURL(date time.Time) string

Types

type Client

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

Client to gh archive.

func New

func New(api ht.Client, dir string, lg *zap.Logger) *Client

func (*Client) Download

func (c *Client) Download(ctx context.Context, opt Options) (*Result, error)

func (*Client) Inventory

func (c *Client) Inventory(ctx context.Context, key string) (*Result, error)

type Hash

type Hash struct {
	io.Writer

	SHA256 hash.Hash
}

func NewHash

func NewHash() Hash

func (Hash) Fields

func (h Hash) Fields() []zap.Field

type Options

type Options struct {
	Progress *Progress
	Key      string
}

type Progress

type Progress struct {
	// Cancel is called when scope of download is done.
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

func (*Progress) Consume

func (p *Progress) Consume() int64

Consume last progress in bytes.

If zero, no progress were made.

func (*Progress) Ready

func (p *Progress) Ready() float64

Ready returns [0..1] value of readiness.

func (*Progress) ReadyBytes

func (p *Progress) ReadyBytes() int64

func (*Progress) Tee

func (p *Progress) Tee() io.Writer

func (*Progress) Total

func (p *Progress) Total() int64

Total input size in bytes.

func (*Progress) Write

func (p *Progress) Write(b []byte) (n int, err error)

type Result

type Result struct {
	Path string

	SizeOutput  int64
	SizeInput   int64
	SizeContent int64

	SHA256Content string
	SHA256Input   string
	SHA256Output  string
}

Jump to

Keyboard shortcuts

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