app

package
v0.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusUnknown  Status = iota
	StatusStarted         = 10
	StatusStarting        = 11
	StatusStopped         = 20
	StatusStopping        = 21
)

Variables

This section is empty.

Functions

func SetManager

func SetManager(mgr Manager)

Types

type Applicable

type Applicable interface {
	Checker
	Installer
	Controller
	Configurator
	Logger
}

func NewApplication

func NewApplication(checker Checker, installer Installer, controller Controller, configurator Configurator, logger Logger) Applicable

type Application

type Application struct {
	Checker
	Installer
	Controller
	Configurator
	Logger
}

type BashFS

type BashFS interface {
	Install() string
	Uninstall() string
	Reinstall() string
}

type CheckError

type CheckError struct {
	NotExistApp   []string
	NotInstallApp []string
}

func (*CheckError) Error

func (c *CheckError) Error() string

type Checker

type Checker interface {
	Check(manager Manager) (ok bool, err error)
}

type ConfigurationCleaner

type ConfigurationCleaner interface {
	Clean() (err error)
}

type ConfigurationLoader

type ConfigurationLoader interface {
	Load(name string) (v string, err error)
}

type Configurator

type Configurator interface {
	Configure(m map[string]any) (err error)
	ConfigurationLoader
	ConfigurationCleaner
}

type Controller

type Controller interface {
	Enable() (ok bool, err error)
	Disable() (ok bool, err error)
	Start() (ok bool, err error)
	Stop() (ok bool, err error)
	Restart() (ok bool, err error)
	Status() (st string, ok bool, err error)
}

type Info

type Info struct {
	AppName     string            // Nginx 1.22.1
	Name        string            // nginx
	Version     string            // 1.22.1
	VersionId   int               // 100
	Pkg         string            // nginx@1.22.1
	Icon        string            // base64;
	Provider    string            // 官方
	Description string            // 轻量级,占有内存少,并发能力强
	Workdir     string            // /duckcp/apps/$Name/$Version
	Type        Type              // 分类
	Tag         map[string]string // Tag

	Installed bool
}

type Installer

type Installer interface {
	Install(ver string) (ok bool, err error)
	Uninstall(ver string) (ok bool, err error)
	Reinstall(ver string) (ok bool, err error)
}

type Logger

type Logger interface {
	File() string
	Truncate() (err error)
}

type Manager

type Manager interface {
	Add(info *Info) (err error)
	Update(info *Info) (err error)
	Delete(pkg string) (err error)
	AddTag(pkg string, tag string) (err error)
	DeleteTag(pkg string, tag string) (err error)
	Installed(pkg string) (err error)
	Uninstalled(pkg string) (err error)
	Required(required ...*Required) (err error)
	FindAll() (apps []*Info, err error)
	FindByPkg(pkg string) (info *Info, err error)
	FindsByType(typ Type) (infos []*Info, err error)
	FindsByName(name string) (infos []*Info, err error)
	FindsByTag(tag string) (infos []*Info, err error)
}

func GetManager

func GetManager() Manager

type Required

type Required struct {
	Name      string
	Version   string
	VersionId int
}

func NewRequired

func NewRequired(name string, version string, versionId int) *Required

type Status

type Status byte

func ParseStatus

func ParseStatus(v string) Status

type Type

type Type uint
const (
	Other       Type = iota // 其他
	Environment             // 运行环境
	SystemTool              // 系统工具
	Plugin                  // 插件
	ThirdParty              // 第三方
	Suite                   // 套件
)

type VersionInstaller

type VersionInstaller interface {
	Install() (ok bool, err error)
	Uninstall() (ok bool, err error)
	Reinstall() (ok bool, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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