extender

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess = iota
	StatusInit
	StatusDownloadFault
	StatusCheckFault
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackList

type CallbackList []ICallback

func (CallbackList) Update

func (ecs CallbackList) Update(es []*Status, success bool)

type Check

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

func NewCheck

func NewCheck(ctx context.Context, callbackFunc ICallback) *Check

func (*Check) Close

func (e *Check) Close() error

func (*Check) Del

func (e *Check) Del(name string)

func (*Check) Get

func (e *Check) Get(name string) (*Item, bool)

func (*Check) Reset

func (e *Check) Reset(data map[string][]byte)

func (*Check) Scan

func (e *Check) Scan()

func (*Check) Set

func (e *Check) Set(name string, ver string)

type Data

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

func NewData

func NewData() *Data

func (*Data) Del

func (e *Data) Del(name string) (*service.ExtendsInfo, error)

func (*Data) GetPlugin

func (e *Data) GetPlugin(id string) (*service.Plugin, error)

func (*Data) List

func (e *Data) List(sortItem string, desc bool) ([]*service.ExtendsInfo, error)

func (*Data) Plugins

func (e *Data) Plugins(name string) ([]*service.Plugin, error)

func (*Data) Reset

func (e *Data) Reset(data []*service.ExtendsInfo) error

func (*Data) Save

func (e *Data) Save(name string, data *service.ExtendsInfo) error

type ICallback

type ICallback interface {
	Update(es []*Status, success bool)
}

func GenCallbackList

func GenCallbackList(hs ...ICallback) ICallback

type Item

type Item struct {
	Group      string
	Project    string
	Version    string
	Status     int
	NextTime   time.Time
	RetryCount int
}

func NewItem

func NewItem(group, project, version string) *Item

func (*Item) Key

func (e *Item) Key() string

func (*Item) Reset

func (e *Item) Reset(version string)

func (*Item) ToStatus

func (e *Item) ToStatus() *Status

type Manager

type Manager struct {
	*Check
	// contains filtered or unexported fields
}

func NewManager

func NewManager(ctx context.Context, callbackFunc ICallback) *Manager

func (*Manager) Del

func (e *Manager) Del(key string) error

func (*Manager) Reset

func (e *Manager) Reset(data map[string][]byte) error

func (*Manager) Set

func (e *Manager) Set(key string, ver string) error

type PluginData

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

func NewPluginData

func NewPluginData() *PluginData

func (*PluginData) All

func (ed *PluginData) All() []*service.Plugin

func (*PluginData) Del

func (ed *PluginData) Del(id string)

func (*PluginData) Get

func (ed *PluginData) Get(id string) (*service.Plugin, error)

func (*PluginData) Reset

func (ed *PluginData) Reset(extenders []*service.Plugin)

func (*PluginData) Set

func (ed *PluginData) Set(extender *service.Plugin)

type Status

type Status struct {
	Group   string
	Project string
	Version string
	Status  int
}

func (*Status) Name

func (s *Status) Name() string

Jump to

Keyboard shortcuts

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