Documentation ¶
Overview ¶
Provides the 'gear' binary extension mechanism and remote execution infrastructure.
Index ¶
- func AddCommand(parent *cobra.Command, c *cobra.Command, local bool) *cobra.Command
- func AddCommandExtension(ext CommandRegistration, local bool)
- func ExtendCommands(parent *cobra.Command, local bool)
- func Fail(code int, format string, other ...interface{})
- func GenerateId() string
- type CliJobResponse
- func (s *CliJobResponse) Failure(e error)
- func (s *CliJobResponse) StreamResult() bool
- func (s *CliJobResponse) Success(t jobs.ResponseSuccess)
- func (s *CliJobResponse) SuccessWithData(t jobs.ResponseSuccess, data interface{})
- func (s *CliJobResponse) SuccessWithWrite(t jobs.ResponseSuccess, flush, structured bool) io.Writer
- func (s *CliJobResponse) WritePending(w io.Writer)
- func (s *CliJobResponse) WritePendingSuccess(name string, value interface{})
- type CommandRegistration
- type Executor
- type FuncBulk
- type FuncReact
- type FuncSerial
- type JobRequest
- type Locator
- type Locators
- type RequestedJob
- type ResourceLocator
- type ResourceLocators
- type ResourceType
- type ResourceValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommand ¶
func AddCommandExtension ¶
func AddCommandExtension(ext CommandRegistration, local bool)
Register an extension to this server during init() or startup
func ExtendCommands ¶
func GenerateId ¶
func GenerateId() string
Types ¶
type CliJobResponse ¶
type CliJobResponse struct { // A response stream to output to. Defaults to DevNull Output io.Writer // true if output should be captured rather than printed Gather bool // Data gathered during request parsing FIXME: move to marshal? Pending map[string]interface{} // Data gathered from the response Data interface{} // The error set on the response Error error // contains filtered or unexported fields }
func (*CliJobResponse) Failure ¶
func (s *CliJobResponse) Failure(e error)
func (*CliJobResponse) StreamResult ¶
func (s *CliJobResponse) StreamResult() bool
func (*CliJobResponse) Success ¶
func (s *CliJobResponse) Success(t jobs.ResponseSuccess)
func (*CliJobResponse) SuccessWithData ¶
func (s *CliJobResponse) SuccessWithData(t jobs.ResponseSuccess, data interface{})
func (*CliJobResponse) SuccessWithWrite ¶
func (s *CliJobResponse) SuccessWithWrite(t jobs.ResponseSuccess, flush, structured bool) io.Writer
func (*CliJobResponse) WritePending ¶
func (s *CliJobResponse) WritePending(w io.Writer)
func (*CliJobResponse) WritePendingSuccess ¶
func (s *CliJobResponse) WritePendingSuccess(name string, value interface{})
type CommandRegistration ¶
Register flags and commands underneath a parent Command
type Executor ¶
type Executor struct { // An interface for converting requests into jobs. Transport transport.Transport // The set of destinations to act on. On Locators // Given a set of locators on the same server, create one // job that represents all ids. Group FuncBulk // Given a set of locators on the same server, create one // job per locator. Serial FuncSerial // The stream to output to, will be set to DevNull by default Output io.Writer // Optional: respond to successful calls OnSuccess FuncReact // Optional: respond to errors when they occur OnFailure FuncReact }
An executor runs a number of local or remote jobs in parallel or sequentially. You must set either .Group or .Serial
func (Executor) StreamAndExit ¶
func (e Executor) StreamAndExit()
type FuncBulk ¶
type FuncBulk func(...Locator) JobRequest
type FuncReact ¶
type FuncReact func(*CliJobResponse, io.Writer, RequestedJob)
type FuncSerial ¶
type FuncSerial func(Locator) JobRequest
type JobRequest ¶
type JobRequest interface{}
type Locator ¶
type Locator interface { // The location of this resource TransportLocator() transport.Locator // Two resources are identical if they have the same // identity value. Identity() string }
func NewResourceLocator ¶
type RequestedJob ¶
type RequestedJob struct { Request JobRequest Job jobs.Job Locator Locator }
type ResourceLocator ¶
type ResourceLocator struct { // The type of resource being referenced Type ResourceType // The identifier of the resource at this location Id string // A label representing a server (varies by transport) At transport.Locator }
The resource on a server reachable via a transport.
func (*ResourceLocator) Identity ¶
func (r *ResourceLocator) Identity() string
func (*ResourceLocator) TransportLocator ¶
func (r *ResourceLocator) TransportLocator() transport.Locator
type ResourceLocators ¶
type ResourceLocators []ResourceLocator
type ResourceType ¶
type ResourceType string
Disambiguate resources with the same id via their type
func SplitTypeHostSuffix ¶
func SplitTypeHostSuffix(value string) (res ResourceType, host string, suffix string, err error)
Given a command line string representing a resource, break it into type, host identity, and suffix
type ResourceValidator ¶
type ResourceValidator interface {
Type() ResourceType
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
The 'gear' binary variations for linux, darwin, and windows.
|
The 'gear' binary variations for linux, darwin, and windows. |
The 'sti' binary.
|
The 'sti' binary. |
The switchns binary - an executable for executing a process inside a running Docker container.
|
The switchns binary - an executable for executing a process inside a running Docker container. |
Click to show internal directories.
Click to hide internal directories.