plugins

package
v0.0.0-...-49d3f61 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func DefaultBindings

func DefaultBindings(opts Options) []string

func DumpManifest

func DumpManifest(manifest *Manifest)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type ActionOpts

type ActionOpts struct {
	ContainerId   string   `json:"container_id"`
	DeleteFolders []string `json:"delete_folders"`
}

type AppConfig

type AppConfig struct {
	ContainerId string
}

type Base

type Base struct {
	Name         string `json:"name"`
	Version      int    `json:"version"`
	Manifest     *Manifest
	DockerClient *docker.Client
	// contains filtered or unexported fields
}

func (*Base) GetManifest

func (self *Base) GetManifest() *Manifest

func (*Base) GetName

func (s *Base) GetName() string

func (*Base) GetVersion

func (s *Base) GetVersion() int

func (*Base) RegisterRPC

func (self *Base) RegisterRPC(server *rpc.Server)

func (*Base) Restart

func (self *Base) Restart(opts *AppConfig) error

func (*Base) Start

func (self *Base) Start(opts *AppConfig) error

func (*Base) Status

func (self *Base) Status(opts *AppConfig) (*docker.State, error)

func (*Base) Stop

func (self *Base) Stop(opts *AppConfig) error

func (*Base) Uninstall

func (self *Base) Uninstall(opts *AppConfig) error

func (*Base) WriteTemplate

func (s *Base) WriteTemplate(templateName string, outputFile string, object Options) error

TODO: Can we extract the baseOpts from the object interface?

type BaseOpts

type BaseOpts struct {
	ContainerId  string     `json:"container_id,omitempty"`
	Password     string     `json:"password,omitempty"`
	WebPort      string     `json:"web_port,omitempty"`
	RunAsUser    string     `json:"run_as_user,omitempty"`
	Username     string     `json:"username,omitempty"`
	ConfigFolder string     `json:"config_folder,omitempty"`
	DataFolder   string     `json:"data_folder,omitempty"`
	MediaFolder  string     `json:"media_folder,omitempty"`
	NoTemplates  string     `json:"no_templates"`
	User         *user.User `json:"user,omitempty"`
}

func (*BaseOpts) GetBaseOpts

func (self *BaseOpts) GetBaseOpts() BaseOpts

func (*BaseOpts) SetDefault

func (opts *BaseOpts) SetDefault(name string) error

type BaseRPC

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

func NewBaseRPC

func NewBaseRPC(parent appPlugin) *BaseRPC

func (*BaseRPC) Restart

func (self *BaseRPC) Restart(opts *ActionOpts, success *bool) error

func (*BaseRPC) Start

func (self *BaseRPC) Start(opts *ActionOpts, success *bool) error

func (*BaseRPC) Status

func (self *BaseRPC) Status(opts *ActionOpts, state *docker.State) error

func (*BaseRPC) Stop

func (self *BaseRPC) Stop(opts *ActionOpts, success *bool) error

func (*BaseRPC) Uninstall

func (self *BaseRPC) Uninstall(opts *ActionOpts, success *bool) error

type FakeType

type FakeType struct {
	DataFolder string
	BaseOpts
}

type Manifest

type Manifest struct {
	Version        float32                   `json:"version"`
	ExposedMethods []string                  `json:"exposed_methods"`
	MethodOptions  map[string][]MethodOption `json:"method_options",yaml: "method_options,flow"`
	ShowOptions    []string                  `json:"show_options"`
	Name           string                    `json:"name"`
	RpcName        string                    `json:"rpc_name"`
	WebUrlFormat   string                    `json:"web_url_format"`
	Description    string                    `json:"description"`
}

func LoadManifest

func LoadManifest(name string) (*Manifest, error)

type MethodOption

type MethodOption struct {
	Name          string `json:"name"`
	DefaultValue  string `json:"default_value", yaml:"default_value"`
	Type          string `json:"type"`
	Hint          string `json:"hint"`
	AllowDeletion bool   `json:"allow_deletion"`
}

type Options

type Options interface {
	GetBaseOpts() BaseOpts
}

type Plugin

type Plugin interface {
	GetName() string
	GetManifest() *Manifest
	GetVersion() int
	RegisterRPC(*rpc.Server)
}

Jump to

Keyboard shortcuts

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