hub

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRepoNotFound  = errors.New("repo not found")
	ErrInternalError = errors.New("internal error")
	ErrRepoExist     = errors.New("repo exist")
)

Functions

func Init

func Init(interval string, op repository.InfoOperator, c repository.Constructor, d repository.DestroyPlugin, initRepoArgs ...interface{})

Init use Singleton pattern design, generating a new Hub that is globally one assigned to the h variable.

Types

type Hub

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

Hub repository manager hub.

func GetInstance

func GetInstance() *Hub

GetInstance get hub instance.

func (*Hub) Add

func (h *Hub) Add(i *repository.Info) error

Add new repo into hub.

func (*Hub) Delete

func (h *Hub) Delete(name string) (repository.Repository, error)

Delete delete repo.

func (*Hub) Get

func (h *Hub) Get(name string) (repository.Repository, error)

Get repo.

func (*Hub) Init

func (h *Hub) Init(interval string) error

Init hub, read and watch repo info.

func (*Hub) List

func (h *Hub) List() []repository.Repository

List get all repo.

func (*Hub) SetConstructor

func (h *Hub) SetConstructor(c repository.Constructor, args ...interface{})

SetConstructor overflow constructor.

func (*Hub) Uninstall

func (h *Hub) Uninstall(pluginID string, brief *repository.InstallerBrief) error

Uninstall plugin.

Jump to

Keyboard shortcuts

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