backend

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGitHubAPIError            = errors.New("github api error")
	ErrInvalidGitHubSlug         = errors.New("repo slug is invalid")
	ErrUnknownGitHubRelease      = errors.New("github release does not exist")
	ErrUnknownGitHubReleaseAsset = errors.New("github release does not contain asset")
)
View Source
var (
	ErrUnsupported    = errors.New("unsupported")
	ErrHTTPStatusCode = errors.New("received a non-200 http status code")
)

Functions

This section is empty.

Types

type BinaryProvider

type BinaryProvider interface {
	Storage
	Path(binary config.Binary) string
}

type CommonConfig

type CommonConfig struct {
	ArchivePathTemplate string           `json:"archive_path_template"`
	Mappings            TemplateMappings `json:"template_mappings"`
}

type FileSystem

type FileSystem struct {
	FileSystemConfig
	// contains filtered or unexported fields
}

func NewFileSystem

func NewFileSystem(logBuilder logger.Builder, c *FileSystemConfig) *FileSystem

func (*FileSystem) Fetch

func (s *FileSystem) Fetch(b config.Binary) ([]byte, error)

func (*FileSystem) Path

func (s *FileSystem) Path(b config.Binary) string

func (*FileSystem) Store

func (s *FileSystem) Store(b config.Binary, content []byte) error

type FileSystemConfig

type FileSystemConfig struct {
	CommonConfig

	FilePathTemplate string `json:"file_path_template"`
}

func (FileSystemConfig) String

func (c FileSystemConfig) String() string

type GCS

type GCS struct {
	GCSConfig
	// contains filtered or unexported fields
}

func NewGCS

func NewGCS(logBuilder logger.Builder, c *GCSConfig) *GCS

func (*GCS) Fetch

func (s *GCS) Fetch(b config.Binary) ([]byte, error)

func (*GCS) Store

func (s *GCS) Store(b config.Binary, content []byte) (err error)

type GCSConfig

type GCSConfig struct {
	CommonConfig

	GCSBucket       string `json:"gcs_bucket"`
	GCSPathTemplate string `json:"gcs_path_template"`
}

func (GCSConfig) String

func (c GCSConfig) String() string

type GitHub

type GitHub struct {
	GitHubConfig
	// contains filtered or unexported fields
}

func NewGitHub

func NewGitHub(logBuilder logger.Builder, c *GitHubConfig) *GitHub

func (*GitHub) Fetch

func (s *GitHub) Fetch(b config.Binary) ([]byte, error)

func (*GitHub) Store

func (s *GitHub) Store(_ config.Binary, _ []byte) error

type GitHubConfig

type GitHubConfig struct {
	CommonConfig

	GitHubSlug                 string `json:"github_slug"`
	GitHubReleaseAssetTemplate string `json:"github_release_asset_template"`
	GitHubBaseURL              string `json:"github_base_url"`
}

func (GitHubConfig) String

func (c GitHubConfig) String() string

type HTTPS

type HTTPS struct {
	HTTPSConfig
	// contains filtered or unexported fields
}

func NewHTTPS

func NewHTTPS(logBuilder logger.Builder, c *HTTPSConfig) *HTTPS

func (*HTTPS) Fetch

func (s *HTTPS) Fetch(b config.Binary) ([]byte, error)

func (*HTTPS) Store

func (s *HTTPS) Store(b config.Binary, content []byte) error

type HTTPSConfig

type HTTPSConfig struct {
	CommonConfig

	HTTPSURLTemplate string `json:"https_url_template"`
}

func (HTTPSConfig) String

func (c HTTPSConfig) String() string

type S3

type S3 struct {
	S3Config
	// contains filtered or unexported fields
}

func NewS3

func NewS3(logBuilder logger.Builder, c *S3Config) *S3

func (*S3) Fetch

func (s *S3) Fetch(b config.Binary) ([]byte, error)

func (*S3) Store

func (s *S3) Store(b config.Binary, content []byte) error

type S3Config

type S3Config struct {
	CommonConfig

	S3Bucket       string `json:"s3_bucket"`
	S3PathTemplate string `json:"s3_path_template"`
}

func (S3Config) String

func (c S3Config) String() string

type Storage

type Storage interface {
	fmt.Stringer
	Fetch(binary config.Binary) ([]byte, error)
	Store(binary config.Binary, content []byte) error
}

type TemplateMappings

type TemplateMappings struct {
	// OS name mappings.
	Darwin  *string `json:"darwin"`
	Linux   *string `json:"linux"`
	Windows *string `json:"windows"`

	// Arch name mappings.
	ARM32 *string `json:"arm32"`
	ARM64 *string `json:"arm64"`
	X86   *string `json:"x86_32"`
	X8664 *string `json:"x86_64"`
}

Jump to

Keyboard shortcuts

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