Documentation ¶
Overview ¶
Serve jobs over the http protocol, and provide a marshalling interface for the default geard jobs.
Index ¶
- 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.JobResponse
- 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 HttpDispatcher
- 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
- func (h *HttpLinkContainersRequest) Handler(conf *HttpConfiguration) JobHandler
- func (h *HttpLinkContainersRequest) HttpMethod() string
- func (h *HttpLinkContainersRequest) HttpPath() string
- func (h *HttpLinkContainersRequest) JobLabel() string
- func (h *HttpLinkContainersRequest) MarshalHttpRequestBody(w io.Writer) error
- 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) JobLabel() 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 JobHandler
- type ListContainersResponse
- type Locator
- type RemoteExecutable
- type RemoteJob
- type RemoteLocator
- type ResponseContentMode
- type StringHeader
- type TabularOutput
Constants ¶
This section is empty.
Variables ¶
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.JobResponse
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 jobs.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 jobs.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 { jobs.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 { jobs.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 { jobs.DeleteContainerRequest DefaultRequest Label string }
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
func (*HttpDeleteContainerRequest) JobLabel ¶
func (h *HttpDeleteContainerRequest) JobLabel() string
type HttpDispatcher ¶
type HttpDispatcher struct {
// contains filtered or unexported fields
}
func NewHttpDispatcher ¶
func NewHttpDispatcher(l RemoteLocator, logger *log.Logger) *HttpDispatcher
func (*HttpDispatcher) Dispatch ¶
func (h *HttpDispatcher) Dispatch(job RemoteExecutable, res jobs.JobResponse) error
type HttpExtension ¶
type HttpExtension func() []HttpJobHandler
type HttpInstallContainerRequest ¶
type HttpInstallContainerRequest struct { jobs.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 { Label string jobs.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) JobLabel ¶
func (h *HttpLinkContainersRequest) JobLabel() string
func (*HttpLinkContainersRequest) MarshalHttpRequestBody ¶
func (h *HttpLinkContainersRequest) MarshalHttpRequestBody(w io.Writer) error
type HttpListBuildsRequest ¶
type HttpListBuildsRequest jobs.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 jobs.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 { jobs.ListContainersRequest DefaultRequest Label string }
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) JobLabel ¶
func (h *HttpListContainersRequest) JobLabel() string
func (*HttpListContainersRequest) UnmarshalHttpResponse ¶
func (h *HttpListContainersRequest) UnmarshalHttpResponse(headers http.Header, r io.Reader, mode ResponseContentMode) (interface{}, error)
type HttpListImagesRequest ¶
type HttpListImagesRequest jobs.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 { jobs.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 { jobs.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 { jobs.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 { jobs.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 { jobs.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 { jobs.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 JobHandler ¶
type JobHandler func(*jobs.JobContext, *rest.Request) (jobs.Job, error)
type ListContainersResponse ¶
type ListContainersResponse struct {
jobs.ListContainersResponse
}
Apply the "label" from the job to the response
func (*ListContainersResponse) WriteTableTo ¶
func (l *ListContainersResponse) WriteTableTo(w io.Writer) error
type RemoteExecutable ¶
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.