Documentation ¶
Index ¶
- func CheckWatchImpl(t *TargetImpl)
- func NewImpl(t *TargetImpl, id int, conf TargetEntry, tasks execution.TaskArray) error
- func RecordImpl(t *TargetImpl, obsData []byte, obsTime time.Duration) error
- func RecvFrom(ch *chan string) (string, error)
- func StartWatchImpl(t *TargetImpl, fn func())
- func StopWatchImpl(t *TargetImpl)
- type Credentials
- type CredentialsMap
- type Situation
- type Target
- type TargetArr
- type TargetDef
- type TargetEntry
- type TargetExec
- type TargetGroup
- type TargetImpl
- type TargetInfo
- type TargetMap
- type TargetObs
- type TargetReport
- type TargetSsh
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckWatchImpl ¶
func CheckWatchImpl(t *TargetImpl)
func NewImpl ¶
func NewImpl(t *TargetImpl, id int, conf TargetEntry, tasks execution.TaskArray) error
func RecordImpl ¶
func RecordImpl(t *TargetImpl, obsData []byte, obsTime time.Duration) error
func StartWatchImpl ¶
func StartWatchImpl(t *TargetImpl, fn func())
func StopWatchImpl ¶
func StopWatchImpl(t *TargetImpl)
Types ¶
type Credentials ¶
type CredentialsMap ¶
type CredentialsMap map[string]Credentials
type Situation ¶
type Situation struct { Targets []string `json:"targets"` Definitions TargetMap `json:"definitions"` Credentials CredentialsMap `json:"credentials"` }
type Target ¶
type Target interface { New(id int, conf TargetEntry, t execution.TaskArray) error Find() error Watch() error Report() (*TargetObs, error) GetImpl() *TargetImpl }
type TargetArr ¶
type TargetArr []TargetEntry
type TargetDef ¶
type TargetDef struct { Id int `json:"id" sql:"id INTEGER NOT NULL"` Name string `json:"name" sql:"-"` GroupId int `json:"group_id" sql:"group_id INTEGER NOT NULL"` Addr string `json:"addr" sql:"address TEXT NOT NULL"` Cred string `json:"cred" sql:"-"` Prot string `json:"prot" sql:"-"` Sys []string `json:"sys" sql:"-"` }
type TargetEntry ¶
type TargetEntry struct { Target TargetDef `json:"target" sql:"CREATE TABLE IF NOT EXISTS target_definitions"` Credentials Credentials `json:"credentials" sql:"CREATE TABLE IF NOT EXISTS target_credentials"` }
func Parse ¶
func Parse(situ *Situation) ([]TargetEntry, error)
type TargetExec ¶
type TargetExec struct {
Impl TargetImpl
}
func (TargetExec) Find ¶
func (t TargetExec) Find() error
func (*TargetExec) GetImpl ¶
func (t *TargetExec) GetImpl() *TargetImpl
func (*TargetExec) New ¶
func (t *TargetExec) New(id int, conf TargetEntry, tasks execution.TaskArray) error
func (*TargetExec) Report ¶
func (t *TargetExec) Report() (*TargetObs, error)
func (TargetExec) Watch ¶
func (t TargetExec) Watch() error
type TargetGroup ¶
type TargetGroup struct { Id int `json:"id" sql:"id INTEGER NOT NULL"` Name string `json:"name" sql:"name TEXT NOT NULL"` Addr []string `json:"addr" sql:"-"` CredId int `json:"cred_id" sql:"credential_id INTEGER NOT NULL"` Cred string `json:"cred" sql:"-"` Prot string `json:"prot" sql:"protocol TEXT NOT NULL"` Sys []string `json:"sys" sql:"system TEXT NOT NULL"` }
type TargetImpl ¶
type TargetInfo ¶
type TargetInfo struct {
Info []string `json:"info"`
}
type TargetMap ¶
type TargetMap map[string]TargetGroup
type TargetObs ¶
func ReportImpl ¶
func ReportImpl(t *TargetImpl) (*TargetObs, error)
type TargetReport ¶
type TargetReport struct { ReportId int64 `db:"report_id" sql:"report_id INTEGER NOT NULL"` TargetId int64 `db:"target_id" sql:"target_id INTEGER NOT NULL"` TaskId int64 `db:"task_id" sql:"task_id INTEGER NOT NULL"` X_Diff float64 `db:"x_diff" sql:"x_diff FLOAT NOT NULL"` Y_Diff float64 `db:"y_diff" sql:"y_diff FLOAT NOT NULL"` Y_Max float64 `db:"y_max" sql:"y_max FLOAT NOT NULL"` Y_Min float64 `db:"y_min" sql:"y_min FLOAT NOT NULL"` Y_Rate float64 `db:"y_rate" sql:"y_rate FLOAT NOT NULL"` X_Val float64 `db:"x_val" sql:"x_val FLOAT NOT NULL"` Y_Val float64 `db:"y_val" sql:"y_val FLOAT NOT NULL"` }
type TargetSsh ¶
type TargetSsh struct { Impl TargetImpl // contains filtered or unexported fields }
func (*TargetSsh) GetImpl ¶
func (t *TargetSsh) GetImpl() *TargetImpl
Click to show internal directories.
Click to hide internal directories.