source

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package source abstracts source of deployable tarballs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source interface {
	// SHA256 returns the expected SHA256 of the tarball.
	SHA256() []byte

	// Open returns a reader with tarballs body.
	//
	// May optionally use the given `tmp` path as a staging file. It's the
	// caller's responsibility to delete it later.
	//
	// The caller should also verify SHA256 of the data it reads matches SHA256().
	Open(ctx context.Context, tmp string) (io.ReadCloser, error)
}

Source indicates how to grab a tarball.

func New

func New(path, sha256hex string) (Source, error)

New initializes a source by validating path format.

`sha256hex` is optional. If given, it indicates the expected digest of the tarball. It will be verified when the tarball is fetched by cache.Cache.

Jump to

Keyboard shortcuts

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