component

package
v0.0.0-...-e08e63e Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DINGO_CLIENT     = "dingo-client"
	DINGO_DACHE      = "dingo-cache"
	DINGO_MDS        = "dingo-mds"
	DINGO_MDS_CLIENT = "dingo-mds-client"
	INSTALLED_FILE   = "installed.json"
	LASTEST_VERSION  = "latest"
	MAIN_VERSION     = "main"
)

Variables

View Source
var (
	ErrAlreadyLatest = errors.New("already with latest build")
	ErrAlreadyExist  = errors.New("already exist")
	ErrNotFound      = errors.New("not found")

	RepostoryDir = fmt.Sprintf("%s/.dingo/components", func() string {
		homeDir, _ := os.UserHomeDir()
		return homeDir
	}())
)
View Source
var (
	Mirror_URL = "https://www.dingodb.com/dingofs"
)

Functions

func ParseComponentVersion

func ParseComponentVersion(input string) (string, string)

input string maybe: dingo-mds:v1.0.0 dingo-client

func URLJoin

func URLJoin(base string, paths ...string) string

Types

type BinaryDetail

type BinaryDetail struct {
	Path      string `json:"path"`
	BuildTime string `json:"build_time"`
	Size      string `json:"size"`
	Commit    string `json:"commit,omitempty"`
}

type BinaryRepoData

type BinaryRepoData struct {
	Binary      string                  `json:"binary"`
	GeneratedAt string                  `json:"generated_at"`
	Branches    map[string]BinaryDetail `json:"branches"`
	Commits     map[string]BinaryDetail `json:"commits"`
	Tags        map[string]BinaryDetail `json:"tags"`
}

func NewBinaryRepoData

func NewBinaryRepoData(url string, name string) (*BinaryRepoData, error)

func ParseBinaryRepoData

func ParseBinaryRepoData(jsonData []byte) (*BinaryRepoData, error)

func ParseFromFile

func ParseFromFile(filename string) (*BinaryRepoData, error)

func ParseFromURL

func ParseFromURL(url string) (*BinaryRepoData, error)

func (*BinaryRepoData) FindVersion

func (b *BinaryRepoData) FindVersion(tag string) (*BinaryDetail, bool)

func (*BinaryRepoData) GetBranches

func (b *BinaryRepoData) GetBranches() map[string]BinaryDetail

func (*BinaryRepoData) GetCommits

func (b *BinaryRepoData) GetCommits() map[string]BinaryDetail

func (*BinaryRepoData) GetLatest

func (b *BinaryRepoData) GetLatest() (string, *BinaryDetail, bool)

func (*BinaryRepoData) GetMain

func (b *BinaryRepoData) GetMain() (*BinaryDetail, bool)

func (*BinaryRepoData) GetName

func (b *BinaryRepoData) GetName() string

func (*BinaryRepoData) GetTags

func (b *BinaryRepoData) GetTags() map[string]BinaryDetail

type Component

type Component struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Commit      string `json:"commit"`
	IsInstalled bool   `json:"installed"`
	IsActive    bool   `json:"active"`
	Release     string `json:"release"`
	Path        string `json:"path"`
	URL         string `json:"url"`
	Updatable   bool   `json:"-"`
}

type ComponentManager

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

func NewComponentManager

func NewComponentManager() (*ComponentManager, error)

func (*ComponentManager) FindInstallComponent

func (cm *ComponentManager) FindInstallComponent(name string, version string) (*Component, error)

func (*ComponentManager) FindVersion

func (cm *ComponentManager) FindVersion(name, version string) (string, *BinaryDetail, error)

func (*ComponentManager) GetActiveComponent

func (cm *ComponentManager) GetActiveComponent(name string) (*Component, error)

func (*ComponentManager) InstallComponent

func (cm *ComponentManager) InstallComponent(name, version string) (*Component, error)

func (*ComponentManager) IsInstalled

func (cm *ComponentManager) IsInstalled(name, version string) bool

func (*ComponentManager) ListComponents

func (cm *ComponentManager) ListComponents() ([]*Component, error)

func (*ComponentManager) LoadAvailableComponentVersions

func (cm *ComponentManager) LoadAvailableComponentVersions(name string) ([]*Component, error)

func (*ComponentManager) LoadAvailableComponents

func (cm *ComponentManager) LoadAvailableComponents() ([]*Component, error)

func (*ComponentManager) LoadInstalledComponents

func (cm *ComponentManager) LoadInstalledComponents() ([]*Component, error)

func (*ComponentManager) RemoveComponent

func (cm *ComponentManager) RemoveComponent(name, version string, force bool, saveToFile bool) error

func (*ComponentManager) RemoveComponents

func (cm *ComponentManager) RemoveComponents(name string, saveToFile bool) ([]*Component, error)

func (*ComponentManager) SaveInstalledComponents

func (cm *ComponentManager) SaveInstalledComponents() error

func (*ComponentManager) SetDefaultVersion

func (cm *ComponentManager) SetDefaultVersion(name, version string) error

func (*ComponentManager) UpdateComponent

func (cm *ComponentManager) UpdateComponent(name, version string) (*Component, error)

func (*ComponentManager) UpdateState

func (cm *ComponentManager) UpdateState(name, version, release string) bool

update component whether is updatable

Jump to

Keyboard shortcuts

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