Documentation ¶
Overview ¶
Serve jobs over the http protocol, and provide a marshalling interface for the core geard jobs.
Index ¶
- Constants
- Variables
- func AddHttpExtension(extension HttpExtension)
- func ApiVersion() string
- func Inline(s string, with ...string) string
- func NewHttpJobResponse(w http.ResponseWriter, skipStreaming bool, mode ResponseContentMode) jobs.Response
- type DefaultRequest
- func (h *DefaultRequest) MarshalHttpRequestBody(w io.Writer) error
- func (h *DefaultRequest) MarshalRequestIdentifier() jobs.RequestIdentifier
- func (h *DefaultRequest) MarshalUrlQuery(query *url.Values)
- func (h *DefaultRequest) SetServer(server string)
- func (h *DefaultRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
- type HeaderSerialization
- type HttpConfiguration
- type HttpExtension
- type HttpJobHandler
- type HttpStreamable
- type HttpTransport
- type JobHandler
- type RemoteExecutable
- type RemoteJob
- type RemoteLocator
- type ResponseContentMode
- type ServerAware
- type StringHeader
- type TabularOutput
Constants ¶
View Source
const DefaultHttpPort = "43273"
Variables ¶
View Source
var (
ErrContentTypeDoesNotMatch = jobs.SimpleError{jobs.ResponseNotAcceptable, "The content type you requested is not available for this action."}
)
Functions ¶
func AddHttpExtension ¶
func AddHttpExtension(extension HttpExtension)
Register an extension to this server during init() or startup
func ApiVersion ¶
func ApiVersion() string
func NewHttpJobResponse ¶
func NewHttpJobResponse(w http.ResponseWriter, skipStreaming bool, mode ResponseContentMode) jobs.Response
Types ¶
type DefaultRequest ¶
type DefaultRequest struct {
Server string `json:"-"`
}
func (*DefaultRequest) MarshalHttpRequestBody ¶
func (h *DefaultRequest) MarshalHttpRequestBody(w io.Writer) error
func (*DefaultRequest) MarshalRequestIdentifier ¶
func (h *DefaultRequest) MarshalRequestIdentifier() jobs.RequestIdentifier
func (*DefaultRequest) MarshalUrlQuery ¶
func (h *DefaultRequest) MarshalUrlQuery(query *url.Values)
func (*DefaultRequest) SetServer ¶
func (h *DefaultRequest) SetServer(server string)
func (*DefaultRequest) UnmarshalHttpResponse ¶
func (h *DefaultRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
type HeaderSerialization ¶
type HeaderSerialization interface {
ToHeader() string
}
type HttpConfiguration ¶
type HttpConfiguration struct { Docker config.DockerConfiguration Dispatcher *dispatcher.Dispatcher }
type HttpExtension ¶
type HttpExtension interface { Routes() []HttpJobHandler HttpJobFor(request interface{}) (RemoteExecutable, error) }
type HttpJobHandler ¶
type HttpJobHandler interface { RemoteJob Handler(conf *HttpConfiguration) JobHandler }
type HttpStreamable ¶
type HttpStreamable interface {
Streamable() bool
}
type HttpTransport ¶
type HttpTransport struct {
// contains filtered or unexported fields
}
func NewHttpTransport ¶
func NewHttpTransport() *HttpTransport
func (*HttpTransport) ExecuteRemote ¶
func (h *HttpTransport) ExecuteRemote(baseUrl *url.URL, job RemoteExecutable, res jobs.Response) error
func (*HttpTransport) LocatorFor ¶
func (h *HttpTransport) LocatorFor(value string) (transport.Locator, error)
func (*HttpTransport) RemoteJobFor ¶
type JobHandler ¶
type JobHandler func(*jobs.JobContext, *rest.Request) (interface{}, error)
type RemoteExecutable ¶
type RemoteExecutable interface { RemoteJob MarshalRequestIdentifier() jobs.RequestIdentifier MarshalUrlQuery(*url.Values) MarshalHttpRequestBody(io.Writer) error UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error) }
func HttpJobFor ¶
func HttpJobFor(job interface{}) (exc RemoteExecutable, err error)
type RemoteLocator ¶
type ResponseContentMode ¶
type ResponseContentMode int
const ( ResponseJson ResponseContentMode = iota ResponseTable )
type ServerAware ¶
type ServerAware interface {
SetServer(string)
}
type StringHeader ¶
type StringHeader string
func (StringHeader) ToHeader ¶
func (s StringHeader) ToHeader() string
type TabularOutput ¶
Click to show internal directories.
Click to hide internal directories.