artifacts

package
v0.1.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GreptimeChartIndexURL is the URL of the Greptime chart index.
	GreptimeChartIndexURL = "https://raw.githubusercontent.com/GreptimeTeam/helm-charts/gh-pages/index.yaml"

	// GreptimeChartReleaseDownloadURL is the URL of the Greptime charts that stored in the GitHub release.
	GreptimeChartReleaseDownloadURL = "https://github.com/GreptimeTeam/helm-charts/releases/download"

	// GreptimeReleaseBucketCN releases bucket public endpoint in CN region.
	GreptimeReleaseBucketCN = "https://downloads.greptime.cn/releases"

	// GreptimeCNCharts is the URL of the Greptime charts that stored in the S3 bucket of the CN region.
	GreptimeCNCharts = GreptimeReleaseBucketCN + "/charts"

	// GreptimeDBCNBinaries is the URL of the GreptimeDB binaries that stored in the S3 bucket of the CN region.
	GreptimeDBCNBinaries = GreptimeReleaseBucketCN + "/greptimedb"

	// EtcdCNBinaries is the URL of the etcd binaries that stored in the S3 bucket of the CN region.
	EtcdCNBinaries = GreptimeReleaseBucketCN + "/etcd"

	// LatestVersionTag is the tag of the latest version.
	LatestVersionTag = "latest"

	// EtcdOCIRegistry is the OCI registry of the etcd chart.
	EtcdOCIRegistry = "oci://registry-1.docker.io/bitnamicharts/etcd"

	// GreptimeGitHubOrg is the GitHub organization of Greptime.
	GreptimeGitHubOrg = "GreptimeTeam"

	// GreptimeDBGithubRepo is the GitHub repository of GreptimeDB.
	GreptimeDBGithubRepo = "greptimedb"

	// EtcdGitHubOrg is the GitHub organization of etcd.
	EtcdGitHubOrg = "etcd-io"

	// EtcdGithubRepo is the GitHub repository of etcd.
	EtcdGithubRepo = "etcd"

	// GreptimeBinName is the artifact name of greptime.
	GreptimeBinName = "greptime"

	// EtcdBinName is the artifact name of etcd.
	EtcdBinName = "etcd"

	// GreptimeDBClusterChartName is the chart name of GreptimeDB.
	GreptimeDBClusterChartName = "greptimedb-cluster"

	// GreptimeDBOperatorChartName is the chart name of GreptimeDB operator.
	GreptimeDBOperatorChartName = "greptimedb-operator"

	// EtcdChartName is the chart name of etcd.
	EtcdChartName = "etcd"

	// DefaultEtcdChartVersion is the default etcd chart version.
	DefaultEtcdChartVersion = "9.2.0"

	// DefaultEtcdBinVersion is the default etcd binary version.
	DefaultEtcdBinVersion = "v3.5.7"
)
View Source
const BreakingChangeVersion = "v0.4.0-nightly-20230802"

BreakingChangeVersion is the version that the download URL of the greptime binary is changed.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactType

type ArtifactType string

ArtifactType is the type of the artifact.

const (
	// ArtifactTypeChart indicates the artifact is a helm chart.
	ArtifactTypeChart ArtifactType = "chart"

	// ArtifactTypeBinary indicates the artifact is a binary.
	ArtifactTypeBinary ArtifactType = "binary"
)

type DownloadOptions

type DownloadOptions struct {
	// If EnableCache is true, the manager will use the cache if the artifact already exists.
	EnableCache bool

	// If the artifact is a binary, the manager will install the binary to the BinaryInstallDir after downloading its package.
	BinaryInstallDir string
}

DownloadOptions is the options for downloading the artifact.

type Manager

type Manager interface {
	// NewSource creates an artifact source with name, version, type and fromCNRegion.
	NewSource(name, version string, typ ArtifactType, fromCNRegion bool) (*Source, error)

	// DownloadTo downloads the artifact from the source to the dest and returns the path of the artifact.
	DownloadTo(ctx context.Context, from *Source, destDir string, opts *DownloadOptions) (string, error)
}

Manager is the interface for managing artifacts. For now, the artifacts can be helm charts and binaries.

func NewManager

func NewManager(logger logger.Logger, opts ...Option) (Manager, error)

NewManager creates a new Manager with workingDir, logger and other options.

type Option

type Option func(*manager)

type Source

type Source struct {
	// The Name of the artifact.
	Name string

	// The FileName of the artifact.
	FileName string

	// The URL of the artifact. It can be the normal http/https URL or the OCI URL.
	URL string

	// The Version of the artifact.
	Version string

	// The type of the artifact.
	Type ArtifactType

	// Indicates whether the artifact is from the CN region.
	FromCNRegion bool
}

Source is the source of the artifact.

Jump to

Keyboard shortcuts

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