Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) GetBuildStatus(ctx context.Context, buildID string) (rd ResponseData, err error)
- func (c *Client) GetVersion(ctx context.Context) (vi VersionInfo, err error)
- func (c *Client) StreamOutput(ctx context.Context, wsURL string) error
- func (c *Client) SubmitBuild(ctx context.Context, d Definition, libraryRef string, libraryURL string) (rd ResponseData, err error)
- type Config
- type Data
- type Definition
- type FileTransport
- type ImageData
- type ImageScripts
- type RequestData
- type ResponseData
- type Scripts
- 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 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 NewClient ¶
NewClient sets up a new build service client with the specified base URL and auth token.
func (*Client) GetBuildStatus ¶
GetBuildStatus gets the status of a build from the Remote Build Service
func (*Client) GetVersion ¶
func (c *Client) GetVersion(ctx context.Context) (vi VersionInfo, err error)
GetVersion gets version information from the build service. The context controls the lifetime of the request.
func (*Client) StreamOutput ¶
StreamOutput reads log output from the websocket URL. The context controls the lifetime of the request.
func (*Client) SubmitBuild ¶
func (c *Client) SubmitBuild(ctx context.Context, d Definition, libraryRef string, libraryURL string) (rd ResponseData, err error)
Build submits a build job to 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 Data ¶
type Data struct { Files []FileTransport `json:"files"` Scripts `json:"buildScripts"` }
Data contains any scripts, metadata, etc... that the Builder may need to know only at build time to build the image
type Definition ¶
type Definition struct { Header map[string]string `json:"header"` ImageData `json:"imageData"` BuildData Data `json:"buildData"` CustomData map[string]string `json:"customData"` Raw []byte `json:"raw"` }
Definition describes how to build an image.
type FileTransport ¶
FileTransport holds source and destination information of files to copy into the container
type ImageData ¶
type ImageData struct { Metadata []byte `json:"metadata"` Labels map[string]string `json:"labels"` ImageScripts `json:"imageScripts"` }
ImageData contains any scripts, metadata, etc... that needs to be present in some from in the final built image
type ImageScripts ¶
type ImageScripts struct { Help string `json:"help"` Environment string `json:"environment"` Runscript string `json:"runScript"` Test string `json:"test"` Startscript string `json:"startScript"` }
ImageScripts contains scripts that are used after build time.
type RequestData ¶
type RequestData struct { Definition `json:"definition"` LibraryRef string `json:"libraryRef"` LibraryURL string `json:"libraryURL"` CallbackURL string `json:"callbackURL"` }
RequestData contains the info necessary for submitting a build to a remote service
type ResponseData ¶
type ResponseData struct { ID string `json:"id"` CreatedBy string `json:"createdBy"` 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"` Definition Definition `json:"definition"` WSURL string `json:"wsURL,omitempty"` LibraryRef string `json:"libraryRef"` LibraryURL string `json:"libraryURL"` CallbackURL string `json:"callbackURL"` }
ResponseData contains the details of an individual build
type Scripts ¶
type Scripts struct { Pre string `json:"pre"` Setup string `json:"setup"` Post string `json:"post"` Test string `json:"test"` }
Scripts defines scripts that are used at build time.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
}
VersionInfo contains version information.