sb_deploy

package
v0.0.0-...-734865c Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BinSrcDropboxDstLocalVersionCacheLifecycle = 86400
	BinSrcDropboxDstLocalVersionCacheName      = "sb_deploy-bin_src_dbx_dst_local_version_cache"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinDeploy

type BinDeploy interface {
	// UpdateIfRequired Update if required
	UpdateIfRequired() (err error)

	// UpdateForce Update forcefully
	UpdateForce() (err error)

	// IsUpdateRequired Check if update is required
	IsUpdateRequired() (required bool, err error)

	// GetLocalLatest Get local latest version and download automatically if
	// no local version found. But this will not check remote versions if local
	// version is found.
	GetLocalLatest() (binaryPath string, version es_version.Version, err error)

	// ListLocalVersions List local versions
	ListLocalVersions() (versions []es_version.Version, versionPaths map[string]string, err error)

	// ListRemoteVersions List remote versions
	ListRemoteVersions() (versions []es_version.Version, versionPaths map[string]string, err error)

	// Download version to temporary path
	Download(version es_version.Version, versionPath string) (downloadPath string, err error)

	// Extract version into cellar
	Extract(version es_version.Version, downloadPath string) (cellarPath string, err error)

	// DeploySymlink Deploy latest binary as symlink
	DeploySymlink() (err error)

	// BinaryName returns the binary name that consider current OS platform
	BinaryName() string

	// LocalLatestBinaryPath returns the path to the latest binary. Returns empty string
	// if no local version found.
	LocalLatestBinaryPath() string
}

func NewBinSrcDropboxDstLocal

func NewBinSrcDropboxDstLocal(recipe BinSrcDropboxDstLocalRecipe, ctl app_control.Control, client dbx_client.Client) BinDeploy

type BinSrcDropboxDstLocalRecipe

type BinSrcDropboxDstLocalRecipe struct {
	// SourceUrl is the url to the shared link folder
	SourceUrl string `json:"source_url"`

	// SourcePassword is the password to access the source. If empty, no password is used.
	SourcePassword string `json:"source_password,omitempty"`

	// BinaryName is the name of the binary file
	BinaryName string `json:"binary_name"`

	// Prefix is the prefix of the file/folder basename.
	Prefix string `json:"prefix"`

	// Suffix is the suffix of the file basename.
	Suffix string `json:"suffix"`

	// CellarPath is the path to store extracted binaries of versions
	CellarPath string `json:"cellar_path"`

	// DeployPath is the path to deploy symlink to the binary.
	// This field is options when no symlink deployment is required.
	DeployPath string `json:"deploy_path,omitempty"`
}

BinSrcDropboxDstLocalRecipe Deploy binary from Dropbox to local This recipe expect folder structure like this: `PREFIX-VERSION/PREFIX-VERSION-SUFFIX.zip`. For example, if prefix is `myapp` and suffix is `linux-amd64`, the folder structure is: `myapp-1.0.0/myapp-1.0.0-linux-amd64.zip`.

type BinSrcDropboxDstLocalRemoteVersionCache

type BinSrcDropboxDstLocalRemoteVersionCache struct {
	// CacheTime is the time when the cache is created in Unix time
	CacheTime int64 `json:"cache_time,omitempty"`

	// Versions is the list of versions
	Versions []es_version.Version `json:"versions,omitempty"`

	// Versions is the list of versions, version string as key and path as value
	VersionPaths map[string]string `json:"version_paths,omitempty"`
}

Jump to

Keyboard shortcuts

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