Documentation ¶
Index ¶
- Variables
- type BuildInfo
- type BuildRequest
- type Client
- func (c *Client) Cancel(ctx context.Context, buildID string) error
- func (c *Client) GetOutput(ctx context.Context, buildID string, w io.Writer) error
- func (c *Client) GetStatus(ctx context.Context, buildID string) (BuildInfo, error)
- func (c *Client) GetVersion(ctx context.Context) (VersionInfo, error)
- func (c *Client) Submit(ctx context.Context, br BuildRequest) (BuildInfo, error)
- type Config
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &Config{}
DefaultConfig is a configuration that uses default values.
Functions ¶
This section is empty.
Types ¶
type BuildInfo ¶ added in v0.0.2
type BuildInfo struct { ID string `json:"id"` SubmitTime time.Time `json:"submitTime"` StartTime *time.Time `json:"startTime,omitempty"` IsComplete bool `json:"isComplete"` CompleteTime *time.Time `json:"completeTime,omitempty"` ImageSize int64 `json:"imageSize,omitempty"` ImageChecksum string `json:"imageChecksum,omitempty"` LibraryRef string `json:"libraryRef"` LibraryURL string `json:"libraryURL"` CallbackURL string `json:"callbackURL"` DefinitionRaw []byte `json:"definitionRaw"` }
BuildInfo contains the details of an individual build
type BuildRequest ¶ added in v0.0.2
type BuildRequest struct { LibraryRef string `json:"libraryRef"` LibraryURL string `json:"libraryURL"` CallbackURL string `json:"callbackURL"` DefinitionRaw []byte `json:"definitionRaw"` BuilderRequirements map[string]string `json:"builderRequirements"` }
BuildRequest contains the info necessary for submitting a build to build service
type Client ¶
type Client struct { // Base URL of the service. BaseURL *url.URL // Auth token to include in the Authorization header of each request (if supplied). AuthToken string // User agent to include in each request (if supplied). UserAgent string // HTTPClient to use to make HTTP requests. HTTPClient *http.Client }
Client describes the client details.
func New ¶ added in v0.0.2
New sets up a new build service client with the specified base URL and auth token.
func (*Client) Cancel ¶ added in v0.1.0
Cancel cancels an existing build. The context controls the lifetime of the request.
func (*Client) GetOutput ¶ added in v0.0.2
GetOutput streams build output for the provided buildID to w. The context controls the lifetime of the request.
func (*Client) GetStatus ¶ added in v0.0.2
GetStatus gets the status of a build from the Build Service by build ID
func (*Client) GetVersion ¶
func (c *Client) GetVersion(ctx context.Context) (VersionInfo, error)
GetVersion gets version information from the build service. The context controls the lifetime of the request.
type Config ¶
type Config struct { // Base URL of the service (https://build.sylabs.io is used if not supplied). BaseURL string // Auth token to include in the Authorization header of each request (if supplied). AuthToken string // User agent to include in each request (if supplied). UserAgent string // HTTPClient to use to make HTTP requests (if supplied). HTTPClient *http.Client }
Config contains the client configuration.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
}
VersionInfo contains version information.