plugin

package
v0.0.0-...-c937b9e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Registry string `json:"registry"` // use public if empty
	Image    string `json:"image"`
}

type Dependence

type Dependence string
const (
	Blocking  Dependence = "blocking"  // plugin will not run if dependency doesn't exist
	Important Dependence = "important" // plugin will run with warnings
	Optional  Dependence = "optional"  // plugin will run with info messages
)

type Desc

type Desc struct {
	Title string `json:"title"` // human readable name
	Info  string `json:"info"`
	Url   string `json:"url"`
}

type LinkType

type LinkType string
const (
	Input    LinkType = "input"    // take output from previous plugin execution
	Output   LinkType = "output"   // send output from current plugin execution to the next plugin
	Parallel LinkType = "parallel" // plugins communicates with each other
)

type Plugin

type Plugin struct {
	Id         bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Name       string        `json:"name" description:"unique plugin id, ex: barbudo/wpscan"` // TODO: do we need aliases or tags?
	Version    string        `json:"version"`
	Type       PluginType    `json:"type" description:"one of: util|script"`
	Weight     PluginWeight  `json:"weight" description:"one of: light|middle|heavy"`
	Desc       *Desc         `json:"desc" description:"human readable description"`
	Container  *Container    `json:"container,omitempty" description:"information about container"`
	Created    time.Time     `json:"created,omitempty" description:"when plugin is created"`
	Updated    time.Time     `json:"updated,omitempty" description:"when plugin is updated"`
	FormSchema string        `json:"formSchema" bson:"formSchema" description:"json schema form description"`

	TargetType target.TargetType `json:"targetType" bson:"targetType" description:"available only for target with this type"`

	//	Requirements []*Required   `json:"requirements,omitempty" description:"other plugins required for running"`
	Enabled bool `json:"enabled" description:"is plugin enabled for running"`
}

func (*Plugin) String

func (p *Plugin) String() string

Short description of plugin

type PluginList

type PluginList struct {
	pagination.Meta `json:",inline"`
	Results         []*Plugin `json:"results"`
}

type PluginType

type PluginType string
const (
	Util   PluginType = "util"
	Script PluginType = "script"
)

func (PluginType) Convert

func (t PluginType) Convert(text string) (interface{}, error)

func (PluginType) Enum

func (t PluginType) Enum() []interface{}

func (PluginType) MarshalJSON

func (t PluginType) MarshalJSON() ([]byte, error)

It's a hack to show custom type as string in swagger

func (PluginType) String

func (t PluginType) String() string

type PluginWeight

type PluginWeight string
const (
	Light  PluginWeight = "light"
	Middle PluginWeight = "middle"
	Heavy  PluginWeight = "heavy"
)

func (PluginWeight) Convert

func (t PluginWeight) Convert(text string) (interface{}, error)

func (PluginWeight) Enum

func (t PluginWeight) Enum() []interface{}

func (PluginWeight) MarshalJSON

func (t PluginWeight) MarshalJSON() ([]byte, error)

It's a hack to show custom type as string in swagger

type Required

type Required struct {
	Plugin     string     `json:"plugin"`                                                      // plugin id, ex: "barbudo/wpscan"
	Versions   []string   `json:"versions"`                                                    // compatible versions
	Dependence Dependence `json:"dependence" description:"one of blocking|important|optional"` // with blocking dependency plugin will not run
}

Jump to

Keyboard shortcuts

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