plugin

package
v0.0.0-...-d23ef4a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 18 Imported by: 6

Documentation

Index

Constants

View Source
const None = 0

Variables

View Source
var (
	ErrCannotFindManifestFile = errors.New("can't find manifest.yml")
)
View Source
var (
	ErrPluginNotRun = errors.New("Plugin is not running")
)

Functions

This section is empty.

Types

type Architecture

type Architecture string
const (
	ARCH_ALL     Architecture = "ALL"     /* Unknown machine. */
	ARCH_X86     Architecture = "X86"     /* x86. */
	ARCH_X86_64  Architecture = "X86_64"  /* x86-64. */
	ARCH_ARM     Architecture = "ARM"     /* ARM. */
	ARCH_AARCH64 Architecture = "AArch64" /* ARM 64-bit Architecture (AArch64) */
	ARCH_MIPS    Architecture = "MIPS"    /* MIPS. */
	ARCH_IA_64   Architecture = "IA-64"   /* Intel IA-64 Processor. */
)

type File

type File struct {
	io.Closer

	PluginManifest PluginManifest
	// contains filtered or unexported fields
}

func OpenReader

func OpenReader(readCloser io.ReaderAt, size int64) (*File, error)

func (*File) Close

func (f *File) Close() error

func (*File) ReleaseToDirectory

func (f *File) ReleaseToDirectory(dir string) error

type InstallFlag

type InstallFlag int32
const (
	Reinstall InstallFlag = 1 << iota
)

func ParseInstallFlag

func ParseInstallFlag(option string) (ret InstallFlag, err error)

type License

type License struct {
	Name string `yaml:"name"`
	Path string `yaml:"desc"`
}

type Machine

type Machine uint16

Machine is found in Header.Machine.

type OS

type OS string

type Pkg

type Pkg struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
}

type PluginManifest

type PluginManifest struct {
	Name         string       `yaml:"name"`
	Desc         string       `yaml:"desc"`
	Version      string       `yaml:"version"`
	Architecture Architecture `yaml:"architecture"`
	OS           OS           `yaml:"os"`
	Homepage     string       `yaml:"homepage"`
	Maintainer   string       `yaml:"maintainer"`
	Checksum     string       `yaml:"checksum"`
	EnterPoint   string       `yaml:"enter-point"`
	Conffiles    []string     `yaml:"conffiles"`
	Deps         []Pkg        `yaml:"deps"`
	SysDeps      []Pkg        `yaml:"sys-deps"`
	Licenses     []License    `yaml:"licenses"`
	PreInstall   []string     `yaml:"pre-install"`
	PostInstall  []string     `yaml:"post-install"`
	CoverFile    string       `yaml:"cover-file"`
	WebsDir      string       `yaml:"webs-dir"`
}

type PositionError

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

func (*PositionError) Error

func (e *PositionError) Error() string

type Service

type Service interface {
	services.ServiceLifeCycle
	ListAll(page uint32, size uint32, sort string, order string) (int64, []models.Plugin, error)
	GetByName(name string) (models.Plugin, error)
	Uninstall(name string, flag UninstallFlag) error
	Install(path string, flag InstallFlag) (models.Plugin, error)
	InstallByReaderAt(readerAt io.ReaderAt, size int64, flag InstallFlag) (models.Plugin, error)
	Start(name string) (protocol.CommandProtocol, error)
	Stop(name string) error
}

func GetInstance

func GetInstance() Service

type UninstallFlag

type UninstallFlag int32
const (
	KeepConfig UninstallFlag = 1 << iota
)

func ParseUninstallFlag

func ParseUninstallFlag(option string) (ret UninstallFlag, err error)

Directories

Path Synopsis
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
grpc
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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