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) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
- type HeaderSerialization
- type HttpBuildImageRequest
- type HttpConfiguration
- type HttpContainerLogRequest
- type HttpContainerStatusRequest
- type HttpContentRequest
- type HttpDeleteContainerRequest
- type HttpExtension
- type HttpInstallContainerRequest
- func (h *HttpInstallContainerRequest) Handler(conf *HttpConfiguration) JobHandler
- func (h *HttpInstallContainerRequest) HttpMethod() string
- func (h *HttpInstallContainerRequest) HttpPath() string
- func (h *HttpInstallContainerRequest) MarshalHttpRequestBody(w io.Writer) error
- func (h *HttpInstallContainerRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
- type HttpJobHandler
- type HttpLinkContainersRequest
- type HttpListBuildsRequest
- type HttpListContainerPortsRequest
- type HttpListContainersRequest
- func (h *HttpListContainersRequest) Handler(conf *HttpConfiguration) JobHandler
- func (h *HttpListContainersRequest) HttpMethod() string
- func (h *HttpListContainersRequest) HttpPath() string
- func (h *HttpListContainersRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
- type HttpListImagesRequest
- type HttpPatchEnvironmentRequest
- type HttpPutEnvironmentRequest
- type HttpRestartContainerRequest
- type HttpRunContainerRequest
- type HttpStartContainerRequest
- type HttpStopContainerRequest
- type HttpStreamable
- type HttpTransport
- type JobHandler
- type ListContainersResponse
- type RemoteExecutable
- type RemoteJob
- type RemoteLocator
- type ResponseContentMode
- 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."}
)
View Source
var ErrHandledResponse = errors.New("Request handled")
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{}
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) UnmarshalHttpResponse ¶
func (h *DefaultRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
type HeaderSerialization ¶
type HeaderSerialization interface {
ToHeader() string
}
type HttpBuildImageRequest ¶
type HttpBuildImageRequest cjobs.BuildImageRequest
func (*HttpBuildImageRequest) Handler ¶
func (h *HttpBuildImageRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpBuildImageRequest) HttpMethod ¶
func (h *HttpBuildImageRequest) HttpMethod() string
func (*HttpBuildImageRequest) HttpPath ¶
func (h *HttpBuildImageRequest) HttpPath() string
type HttpConfiguration ¶
type HttpConfiguration struct { Docker config.DockerConfiguration Dispatcher *dispatcher.Dispatcher }
func (*HttpConfiguration) Handler ¶
func (conf *HttpConfiguration) Handler() http.Handler
type HttpContainerLogRequest ¶
type HttpContainerLogRequest cjobs.ContainerLogRequest
func (*HttpContainerLogRequest) Handler ¶
func (h *HttpContainerLogRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpContainerLogRequest) HttpMethod ¶
func (h *HttpContainerLogRequest) HttpMethod() string
func (*HttpContainerLogRequest) HttpPath ¶
func (h *HttpContainerLogRequest) HttpPath() string
type HttpContainerStatusRequest ¶
type HttpContainerStatusRequest struct { cjobs.ContainerStatusRequest DefaultRequest }
func (*HttpContainerStatusRequest) Handler ¶
func (h *HttpContainerStatusRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpContainerStatusRequest) HttpMethod ¶
func (h *HttpContainerStatusRequest) HttpMethod() string
func (*HttpContainerStatusRequest) HttpPath ¶
func (h *HttpContainerStatusRequest) HttpPath() string
type HttpContentRequest ¶
type HttpContentRequest struct { cjobs.ContentRequest DefaultRequest }
func (*HttpContentRequest) Handler ¶
func (h *HttpContentRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpContentRequest) HttpMethod ¶
func (h *HttpContentRequest) HttpMethod() string
func (*HttpContentRequest) HttpPath ¶
func (h *HttpContentRequest) HttpPath() string
type HttpDeleteContainerRequest ¶
type HttpDeleteContainerRequest struct { cjobs.DeleteContainerRequest DefaultRequest }
func (*HttpDeleteContainerRequest) Handler ¶
func (h *HttpDeleteContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpDeleteContainerRequest) HttpMethod ¶
func (h *HttpDeleteContainerRequest) HttpMethod() string
func (*HttpDeleteContainerRequest) HttpPath ¶
func (h *HttpDeleteContainerRequest) HttpPath() string
type HttpExtension ¶
type HttpExtension interface { Routes() []HttpJobHandler HttpJobFor(job jobs.Job) (RemoteExecutable, error) }
type HttpInstallContainerRequest ¶
type HttpInstallContainerRequest struct { cjobs.InstallContainerRequest DefaultRequest }
func (*HttpInstallContainerRequest) Handler ¶
func (h *HttpInstallContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpInstallContainerRequest) HttpMethod ¶
func (h *HttpInstallContainerRequest) HttpMethod() string
func (*HttpInstallContainerRequest) HttpPath ¶
func (h *HttpInstallContainerRequest) HttpPath() string
func (*HttpInstallContainerRequest) MarshalHttpRequestBody ¶
func (h *HttpInstallContainerRequest) MarshalHttpRequestBody(w io.Writer) error
func (*HttpInstallContainerRequest) UnmarshalHttpResponse ¶
func (h *HttpInstallContainerRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
type HttpJobHandler ¶
type HttpJobHandler interface { RemoteJob Handler(conf *HttpConfiguration) JobHandler }
type HttpLinkContainersRequest ¶
type HttpLinkContainersRequest struct { cjobs.LinkContainersRequest DefaultRequest }
func (*HttpLinkContainersRequest) Handler ¶
func (h *HttpLinkContainersRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpLinkContainersRequest) HttpMethod ¶
func (h *HttpLinkContainersRequest) HttpMethod() string
func (*HttpLinkContainersRequest) HttpPath ¶
func (h *HttpLinkContainersRequest) HttpPath() string
func (*HttpLinkContainersRequest) MarshalHttpRequestBody ¶
func (h *HttpLinkContainersRequest) MarshalHttpRequestBody(w io.Writer) error
type HttpListBuildsRequest ¶
type HttpListBuildsRequest cjobs.ListBuildsRequest
func (*HttpListBuildsRequest) Handler ¶
func (h *HttpListBuildsRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpListBuildsRequest) HttpMethod ¶
func (h *HttpListBuildsRequest) HttpMethod() string
func (*HttpListBuildsRequest) HttpPath ¶
func (h *HttpListBuildsRequest) HttpPath() string
type HttpListContainerPortsRequest ¶
type HttpListContainerPortsRequest cjobs.ContainerPortsRequest
func (*HttpListContainerPortsRequest) Handler ¶
func (h *HttpListContainerPortsRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpListContainerPortsRequest) HttpMethod ¶
func (h *HttpListContainerPortsRequest) HttpMethod() string
func (*HttpListContainerPortsRequest) HttpPath ¶
func (h *HttpListContainerPortsRequest) HttpPath() string
type HttpListContainersRequest ¶
type HttpListContainersRequest struct { cjobs.ListContainersRequest DefaultRequest }
func (*HttpListContainersRequest) Handler ¶
func (h *HttpListContainersRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpListContainersRequest) HttpMethod ¶
func (h *HttpListContainersRequest) HttpMethod() string
func (*HttpListContainersRequest) HttpPath ¶
func (h *HttpListContainersRequest) HttpPath() string
func (*HttpListContainersRequest) UnmarshalHttpResponse ¶
func (h *HttpListContainersRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
type HttpListImagesRequest ¶
type HttpListImagesRequest cjobs.ListImagesRequest
func (*HttpListImagesRequest) Handler ¶
func (h *HttpListImagesRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpListImagesRequest) HttpMethod ¶
func (h *HttpListImagesRequest) HttpMethod() string
func (*HttpListImagesRequest) HttpPath ¶
func (h *HttpListImagesRequest) HttpPath() string
type HttpPatchEnvironmentRequest ¶
type HttpPatchEnvironmentRequest struct { cjobs.PatchEnvironmentRequest DefaultRequest }
func (*HttpPatchEnvironmentRequest) Handler ¶
func (h *HttpPatchEnvironmentRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpPatchEnvironmentRequest) HttpMethod ¶
func (h *HttpPatchEnvironmentRequest) HttpMethod() string
func (*HttpPatchEnvironmentRequest) HttpPath ¶
func (h *HttpPatchEnvironmentRequest) HttpPath() string
func (*HttpPatchEnvironmentRequest) MarshalHttpRequestBody ¶
func (h *HttpPatchEnvironmentRequest) MarshalHttpRequestBody(w io.Writer) error
type HttpPutEnvironmentRequest ¶
type HttpPutEnvironmentRequest struct { cjobs.PutEnvironmentRequest DefaultRequest }
func (*HttpPutEnvironmentRequest) Handler ¶
func (h *HttpPutEnvironmentRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpPutEnvironmentRequest) HttpMethod ¶
func (h *HttpPutEnvironmentRequest) HttpMethod() string
func (*HttpPutEnvironmentRequest) HttpPath ¶
func (h *HttpPutEnvironmentRequest) HttpPath() string
func (*HttpPutEnvironmentRequest) MarshalHttpRequestBody ¶
func (h *HttpPutEnvironmentRequest) MarshalHttpRequestBody(w io.Writer) error
type HttpRestartContainerRequest ¶
type HttpRestartContainerRequest struct { cjobs.RestartContainerRequest DefaultRequest }
func (*HttpRestartContainerRequest) Handler ¶
func (h *HttpRestartContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpRestartContainerRequest) HttpMethod ¶
func (h *HttpRestartContainerRequest) HttpMethod() string
func (*HttpRestartContainerRequest) HttpPath ¶
func (h *HttpRestartContainerRequest) HttpPath() string
type HttpRunContainerRequest ¶
type HttpRunContainerRequest struct { cjobs.RunContainerRequest DefaultRequest }
func (*HttpRunContainerRequest) Handler ¶
func (h *HttpRunContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpRunContainerRequest) HttpMethod ¶
func (h *HttpRunContainerRequest) HttpMethod() string
func (*HttpRunContainerRequest) HttpPath ¶
func (h *HttpRunContainerRequest) HttpPath() string
func (*HttpRunContainerRequest) MarshalHttpRequestBody ¶
func (h *HttpRunContainerRequest) MarshalHttpRequestBody(w io.Writer) error
type HttpStartContainerRequest ¶
type HttpStartContainerRequest struct { cjobs.StartedContainerStateRequest DefaultRequest }
func (*HttpStartContainerRequest) Handler ¶
func (h *HttpStartContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpStartContainerRequest) HttpMethod ¶
func (h *HttpStartContainerRequest) HttpMethod() string
func (*HttpStartContainerRequest) HttpPath ¶
func (h *HttpStartContainerRequest) HttpPath() string
type HttpStopContainerRequest ¶
type HttpStopContainerRequest struct { cjobs.StoppedContainerStateRequest DefaultRequest }
func (*HttpStopContainerRequest) Handler ¶
func (h *HttpStopContainerRequest) Handler(conf *HttpConfiguration) JobHandler
func (*HttpStopContainerRequest) HttpMethod ¶
func (h *HttpStopContainerRequest) HttpMethod() string
func (*HttpStopContainerRequest) HttpPath ¶
func (h *HttpStopContainerRequest) HttpPath() string
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) (jobs.Job, error)
type ListContainersResponse ¶
type ListContainersResponse struct {
cjobs.ListContainersResponse
}
Apply the "label" from the job to the response
func (*ListContainersResponse) WriteTableTo ¶
func (l *ListContainersResponse) WriteTableTo(w io.Writer) 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 jobs.Job) (exc RemoteExecutable, err error)
type RemoteLocator ¶
type ResponseContentMode ¶
type ResponseContentMode int
const ( ResponseJson ResponseContentMode = iota ResponseTable )
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.