agent

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 Agent

type Agent struct {
	Id     bson.ObjectId `json:"id,omitempty" bson:"_id"` // autogenerated id
	Name   string        `json:"name"`                    // unique name is usually a hostname
	Status Status        `json:"status,omitempty" description:"one of [registered|approved|waiting|paused|unavailable|blocked]"`
	Type   Type          `json:"type,omitempty" description:"one of [system]"`

	Created time.Time `json:"created,omitempty" description:"when plan is created"`
	Updated time.Time `json:"updated,omitempty" description:"when plan is updated"`
}

func New

func New() *Agent

func (*Agent) String

func (a *Agent) String() string

type AgentList

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

type Job

type Job struct {
	Cmd JobCmd `json:"cmd" description:"one of [repeat|scan]"`

	Scan *scan.Session
}

func (*Job) String

func (j *Job) String() string

type JobCmd

type JobCmd string
const (
	CmdRepeat JobCmd = "repeat" // just repeat request
	CmdScan   JobCmd = "scan"
)

type Status

type Status string
const (
	StatusUndefined  Status = ""           // Agent has undefined state if it isn't registered yet in system
	StatusRegistered Status = "registered" // Agent registered in system, but doesn't approved
	StatusApproved   Status = "approved"
	StatusBlocked    Status = "blocked" // agent was blocked by some reasons
)

func (Status) Convert

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

func (Status) Enum

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

func (Status) MarshalJSON

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

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

type Type

type Type string
const (
	System Type = "system"
)

func (Type) Convert

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

func (Type) Enum

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

func (Type) MarshalJSON

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

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

Jump to

Keyboard shortcuts

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