extender

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 7 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 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 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