storage

package
v0.0.0-...-39baee9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureParentDir

func EnsureParentDir(subdir string) (string, error)

Types

type GithubStorage

type GithubStorage struct {
	Owner          string
	RepositoryName string
	Repository     *github.Repository
	Client         *github.Client
	// contains filtered or unexported fields
}

func NewGithubStorage

func NewGithubStorage(owner, repo, apiKey string) (GithubStorage, error)

func (GithubStorage) Download

func (g GithubStorage) Download(checksum string) (io.ReadCloser, error)

func (GithubStorage) EnsureRepo

func (g GithubStorage) EnsureRepo() (*github.Repository, error)

func (GithubStorage) FindBinary

func (g GithubStorage) FindBinary() (*github.RepositoryContent, error)

func (GithubStorage) Path

func (g GithubStorage) Path(checksum string) (string, error)

func (GithubStorage) Upload

func (g GithubStorage) Upload(reader io.ReadCloser) (string, error)

type LocalStorage

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

func NewLocalStorage

func NewLocalStorage() (LocalStorage, error)

func (LocalStorage) Download

func (l LocalStorage) Download(checksum string) (io.ReadCloser, error)

func (LocalStorage) Path

func (l LocalStorage) Path(checksum string) (string, error)

func (LocalStorage) Upload

func (l LocalStorage) Upload(reader io.ReadCloser) (string, error)

type Storage

type Storage interface {
	Upload(reader io.ReadCloser) (string, error)
	Download(checksum string) (io.ReadCloser, error)
	Path(checksum string) (string, error)
}

Jump to

Keyboard shortcuts

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