transport

package
v0.0.0-...-2bb29a1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Provides an abstraction for job transport.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotTransportable = errors.New("The specified job cannot be executed remotely")
View Source
var Local = HostLocator(localTransport)

The local transport - test against this variable for finding a local interface.

Functions

func GetTransportNames

func GetTransportNames() []string

func RegisterTransport

func RegisterTransport(name string, t Transport)

Define the implementation of a transport for use

func ResolveLocatorHostname

func ResolveLocatorHostname(value string) (string, error)

Types

type HostLocator

type HostLocator string

A host port combination representing a remote server - most IP transports can use this default implementation.

func NewHostLocator

func NewHostLocator(value string) (HostLocator, error)

Return an object representing an IP host

func (HostLocator) IsRemote

func (t HostLocator) IsRemote() bool

func (HostLocator) ResolveHostname

func (t HostLocator) ResolveHostname() (string, error)

func (HostLocator) String

func (t HostLocator) String() string

type Locator

type Locator interface {
	// A string that uniquely identifies this destination
	String() string
	// Return a valid hostname for this locator
	ResolveHostname() (string, error)
}

The destination of a transport. All transports must provide a way to resolve the IP remote hostname.

type Locators

type Locators []Locator

func NewTransportLocators

func NewTransportLocators(transport Transport, values ...string) (Locators, error)

Convenience method for converting a set of strings into a list of Locators

type Transport

type Transport interface {
	// Return a locator from the given string
	LocatorFor(string) (Locator, error)
	// Given a locator, return a job that can be executed
	// remotely.  May return ErrNotTransportable or
	// ErrNoJobForRequest
	RemoteJobFor(Locator, interface{}) (jobs.Job, error)
}

Allow Jobs to be remotely executed.

func GetTransport

func GetTransport(name string) (Transport, bool)

type TransportFlag

type TransportFlag struct {
	Transport
	// contains filtered or unexported fields
}

Implement the flag.Value interface for reading a transport from a string.

func (*TransportFlag) Get

func (t *TransportFlag) Get() Transport

func (*TransportFlag) Set

func (t *TransportFlag) Set(s string) error

func (*TransportFlag) String

func (t *TransportFlag) String() string

Jump to

Keyboard shortcuts

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