simple

package
v0.0.0-...-5c345c6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: MIT Imports: 8 Imported by: 0

README

simple

simple

Package simple is a simple task provider proof of concept.

Usage

type CPUInfo
type CPUInfo struct {
	Processor int `json:"processor"`
	MHz       int `json:"mhz"`
}

CPUInfo is information on a particular CPU.

type CPUInfoArgs
type CPUInfoArgs struct {
	GuestID string `json:"guest_id"`
}

CPUInfoArgs are arguments for the CPUInfo handler.

type CPUInfoResult
type CPUInfoResult []*CPUInfo

CPUInfoResult is the result data for the CPUInfo handler.

type DelayedRespArgs
type DelayedRespArgs struct {
	Delay time.Duration `json:"delay"`
}

DelayedRespArgs are arguments for the DelayedResp handler.

type DelayedRespResult
type DelayedRespResult struct {
	Delay       time.Duration `json:"delay"`
	ReceivedAt  time.Time     `json:"received_at"`
	RespondedAt time.Time     `json:"responded_at"`
}

DelayedRespResult is the result data for the DelayedResp handler.

type DiskInfo
type DiskInfo struct {
	Device string
	Size   int64
}

DiskInfo is information on a particular disk.

type DiskInfoArgs
type DiskInfoArgs struct {
	GuestID string `json:"guest_id"`
}

DiskInfoArgs are arguments for the DiskInfo handler.

type DiskInfoResult
type DiskInfoResult []*DiskInfo

DiskInfoResult is the result data for the DiskInfo handler.

type Simple
type Simple struct {
}

Simple is a simple provider implementation.

func NewSimple
func NewSimple(config *provider.Config, tracker *acomm.Tracker) *Simple

NewSimple creates a new instance of Simple.

func (*Simple) CPUInfo
func (s *Simple) CPUInfo(req *acomm.Request) (interface{}, *url.URL, error)

CPUInfo is a task handler to retrieve information about CPUs.

func (*Simple) DelayedResp
func (s *Simple) DelayedResp(req *acomm.Request) (interface{}, *url.URL, error)

DelayedResp is a task handler that waits a specified time before returning.

func (*Simple) DiskInfo
func (s *Simple) DiskInfo(req *acomm.Request) (interface{}, *url.URL, error)

DiskInfo is a task handler to retrieve information about disks.

func (*Simple) RegisterTasks
func (s *Simple) RegisterTasks(server *provider.Server)

RegisterTasks registers all of Simple's task handlers with the server.

func (*Simple) StreamEcho
func (s *Simple) StreamEcho(req *acomm.Request) (interface{}, *url.URL, error)

StreamEcho is a task handler to echo input back via streaming data.

func (*Simple) SystemStatus
func (s *Simple) SystemStatus(req *acomm.Request) (interface{}, *url.URL, error)

SystemStatus is a task handler to retrieve info look up and return system information. It depends on and makes requests for several other tasks.

type SystemStatusArgs
type SystemStatusArgs struct {
	GuestID string `json:"guest_id"`
}

SystemStatusArgs are arguments for the SystemStatus handler.

type SystemStatusResult
type SystemStatusResult struct {
	CPUs  []*CPUInfo  `json:"cpus"`
	Disks []*DiskInfo `json:"disks"`
}

SystemStatusResult is the result data for the SystemStatus handler.

-- Generated with godocdown

Documentation

Overview

Package simple is a simple task provider proof of concept.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	Processor int `json:"processor"`
	MHz       int `json:"mhz"`
}

CPUInfo is information on a particular CPU.

type CPUInfoArgs

type CPUInfoArgs struct {
	GuestID string `json:"guest_id"`
}

CPUInfoArgs are arguments for the CPUInfo handler.

type CPUInfoResult

type CPUInfoResult []*CPUInfo

CPUInfoResult is the result data for the CPUInfo handler.

type DelayedRespArgs

type DelayedRespArgs struct {
	Delay time.Duration `json:"delay"`
}

DelayedRespArgs are arguments for the DelayedResp handler.

type DelayedRespResult

type DelayedRespResult struct {
	Delay       time.Duration `json:"delay"`
	ReceivedAt  time.Time     `json:"received_at"`
	RespondedAt time.Time     `json:"responded_at"`
}

DelayedRespResult is the result data for the DelayedResp handler.

type DiskInfo

type DiskInfo struct {
	Device string
	Size   int64
}

DiskInfo is information on a particular disk.

type DiskInfoArgs

type DiskInfoArgs struct {
	GuestID string `json:"guest_id"`
}

DiskInfoArgs are arguments for the DiskInfo handler.

type DiskInfoResult

type DiskInfoResult []*DiskInfo

DiskInfoResult is the result data for the DiskInfo handler.

type Simple

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

Simple is a simple provider implementation.

func NewSimple

func NewSimple(config *provider.Config, tracker *acomm.Tracker) *Simple

NewSimple creates a new instance of Simple.

func (*Simple) CPUInfo

func (s *Simple) CPUInfo(req *acomm.Request) (interface{}, *url.URL, error)

CPUInfo is a task handler to retrieve information about CPUs.

func (*Simple) DelayedResp

func (s *Simple) DelayedResp(req *acomm.Request) (interface{}, *url.URL, error)

DelayedResp is a task handler that waits a specified time before returning.

func (*Simple) DiskInfo

func (s *Simple) DiskInfo(req *acomm.Request) (interface{}, *url.URL, error)

DiskInfo is a task handler to retrieve information about disks.

func (*Simple) RegisterTasks

func (s *Simple) RegisterTasks(server *provider.Server)

RegisterTasks registers all of Simple's task handlers with the server.

func (*Simple) StreamEcho

func (s *Simple) StreamEcho(req *acomm.Request) (interface{}, *url.URL, error)

StreamEcho is a task handler to echo input back via streaming data.

func (*Simple) SystemStatus

func (s *Simple) SystemStatus(req *acomm.Request) (interface{}, *url.URL, error)

SystemStatus is a task handler to retrieve info look up and return system information. It depends on and makes requests for several other tasks.

type SystemStatusArgs

type SystemStatusArgs struct {
	GuestID string `json:"guest_id"`
}

SystemStatusArgs are arguments for the SystemStatus handler.

type SystemStatusResult

type SystemStatusResult struct {
	CPUs  []*CPUInfo  `json:"cpus"`
	Disks []*DiskInfo `json:"disks"`
}

SystemStatusResult is the result data for the SystemStatus handler.

Directories

Path Synopsis
cmd
provider-simple
Usage $ provider-simple -h Usage of provider-simple: -c, --config_file="": path to config file -p, --default_priority=50: default task priority -l, --log_level="warning": log level: debug/info/warn/error/fatal/panic -t, --request_timeout=0: default timeout for requests made by this provider in seconds -s, --socket_dir="/tmp/cerana": base directory in which to create task sockets
Usage $ provider-simple -h Usage of provider-simple: -c, --config_file="": path to config file -p, --default_priority=50: default task priority -l, --log_level="warning": log level: debug/info/warn/error/fatal/panic -t, --request_timeout=0: default timeout for requests made by this provider in seconds -s, --socket_dir="/tmp/cerana": base directory in which to create task sockets

Jump to

Keyboard shortcuts

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