Documentation ¶
Overview ¶
Package msg provides means for client and server to communicate.
Index ¶
- Constants
- type Cmd
- type Quantity
- type QueryParam
- type Response
- func (r *Response) AddAbortedTask(task Task)
- func (r *Response) AddCurrentTask(task Task)
- func (r *Response) AddPong()
- func (r *Response) AddQuerySummaries(sum []Summary)
- func (r *Response) AddShutdownMessage()
- func (r *Response) AddStartedTask(task Task)
- func (r *Response) AddStoppedTask(task Task)
- func (r *Response) Err() error
- func (r *Response) Failed() bool
- func (r *Response) SetError(err error)
- func (r *Response) SetListening()
- type Summary
- type Task
Constants ¶
View Source
const ( // Status RespError = "error" RespSuccess = "success" // Type RespStartTask = "start" RespStopTask = "stop" RespCurrentTask = "current" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct { Op string `json:"operation"` // The operation to perform Flags map[string]bool `json:"flags"` // Possible flags Opts map[string]string `json:"options"` // Possible options TaskNames []string `json:"tasks"` // The tasks for any related requests Body [][]string `json:"body"` // The body containing the command information Quantities []Quantity `json:"quantifiers"` // Quantifiers, e.g. for queries QueryParams []QueryParam `json:"query_params"` // The parameters for a query }
type QueryParam ¶
type QueryParam []string
type Response ¶
type Response struct { Status string `json:"status"` Error string `json:"error"` Body [][]string `json:"body"` }
Response represents a server's answer to a client's request.
func (*Response) AddAbortedTask ¶
func (*Response) AddCurrentTask ¶
func (*Response) AddQuerySummaries ¶
Create a response containing the given query summaries.
func (*Response) AddShutdownMessage ¶
func (r *Response) AddShutdownMessage()
func (*Response) AddStartedTask ¶
func (*Response) AddStoppedTask ¶
func (*Response) SetListening ¶
func (r *Response) SetListening()
type Summary ¶
type Summary struct { Task string Details Quantity Total time.Duration Start time.Time End time.Time }
Summary represents all relevant information concerning a single request
Click to show internal directories.
Click to hide internal directories.