backend

package
v0.0.0-...-ebca4f8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package backend is responsible for storing and fetching asset from or to the designated location.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// Name of the asset which has to be either uploaded or downloaded.
	Name string `json:"name" yaml:"name"`
	// Cloud name of the bucket to which asset belongs to.
	Cloud string `json:"cloud" yaml:"cloud"`
	// Bucket name in appropriate cloud for asset store.
	Bucket string `json:"bucket" yaml:"bucket"`
	// Folder under which the asset has to be placed.
	Folder string `json:"folder" yaml:"folder"`
	// Path to the asset which has to be store on to cloud.
	Path string `json:"path" yaml:"path"`
	// TargetPath refers to path where the asset has to be fetched to.
	TargetPath string `json:"targetpath" yaml:"targetpath"`
	// Path to cloud credentail file, 'service-account.json' incase of gcp.
	CredentialPath string `json:"credspath" yaml:"credspath" env:"UNPACKKER_CREDENTIAL_PATH"`
	// CredentialType of for cloud config. Unpackker supports two type, default and file type.
	// It defaults to default config.
	CredentialType string `json:"credstype" yaml:"credstype" env:"UNPACKKER_CREDENTIAL_TYPE"`
	// SkipRemoteCheck would skip feature which avoids pushing asset which is present at backend.
	SkipRemoteCheck bool `json:"skipremotecheck" yaml:"skipremotecheck"`
	// Region where the bucket resides.
	Region string `json:"region" yaml:"region" env:"UNPACKKER_CLOUD_REGION"`
	// Metadata of the asset that would be stored.
	MetaData map[string]string `json:"metadata" yaml:"metadata"`
	// contains filtered or unexported fields
}

Store helps one to specify where the artifact should be tranported, default to local.

func New

func New() *Store

New returns new config of Store.

func (*Store) FetchAsset

func (b *Store) FetchAsset() error

FetchAsset stores the packed asset at specified location. Make sure that InitBackend is invoked before calling this.

func (*Store) InitBackend

func (b *Store) InitBackend() error

InitBackend initializes backend for Unpackker to store or retrieve the packed asset.

func (*Store) StoreAsset

func (b *Store) StoreAsset() error

StoreAsset stores the packed asset at specified location. Make sure that InitBackend is invoked before calling this.

Jump to

Keyboard shortcuts

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