request

package
v0.0.0-...-b4339e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_DESCRIPTION_LIMIT = 512
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildCommit

type BuildCommit struct {
	Hash     string    `json:"hash"`
	Username string    `json:"username"`
	Message  string    `json:"message"`
	Email    string    `json:"email"`
	Date     time.Time `json:"date"`
}

type BuildCreateOptions

type BuildCreateOptions struct {
	Tag        string            `json:"tag"`
	Auth       string            `json:"auth"`
	DockerFile string            `json:"dockerfile"`
	Context    string            `json:"context"`
	EnvVars    []string          `json:"environments"`
	Command    string            `json:"command"`
	Workdir    string            `json:"workdir"`
	Source     ImageSource       `json:"source"`
	Labels     map[string]string `json:"labels"`
}

func (*BuildCreateOptions) DecodeAndValidate

func (b *BuildCreateOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*BuildCreateOptions) ToJson

func (b *BuildCreateOptions) ToJson() ([]byte, error)

func (*BuildCreateOptions) Validate

func (b *BuildCreateOptions) Validate() *errors.Err

type BuildEvent

type BuildEvent struct {
	ID         string      `json:"id"`
	Number     int64       `json:"number"`
	Commit     BuildCommit `json:"commit"`
	Branch     string      `json:"branch"`
	Image      string      `json:"image"`
	ImageSha   string      `json:"image_sha"`
	Source     string      `json:"source"`
	Size       int64       `json:"size"`
	Step       string      `json:"step"`
	Status     string      `json:"status"`
	Message    string      `json:"message"`
	Processing bool        `json:"processing"`
	Done       bool        `json:"done"`
	Error      bool        `json:"error"`
	Canceled   bool        `json:"canceled"`
	Finished   *time.Time  `json:"finished"`
	Started    *time.Time  `json:"started"`
}

type BuildListOptions

type BuildListOptions struct {
	Active *bool  `json:"active"`
	Page   *int64 `json:"page"`
	Limit  *int64 `json:"limit"`
}

type BuildLogsOptions

type BuildLogsOptions struct {
	Follow bool `json:"follow"`
}

type BuildRequest

type BuildRequest struct{}

func (BuildRequest) BuildExecuteOptions

func (BuildRequest) BuildExecuteOptions() *BuildCreateOptions

func (BuildRequest) BuildStatusOptions

func (BuildRequest) BuildStatusOptions() *BuildUpdateStatusOptions

type BuildUpdateStatusOptions

type BuildUpdateStatusOptions struct {
	Step     string     `json:"step"`
	Message  string     `json:"message"`
	Error    bool       `json:"error"`
	Canceled bool       `json:"canceled"`
	Image    *ImageInfo `json:"image"`
}

func (*BuildUpdateStatusOptions) DecodeAndValidate

func (b *BuildUpdateStatusOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*BuildUpdateStatusOptions) ToJson

func (b *BuildUpdateStatusOptions) ToJson() ([]byte, error)

func (*BuildUpdateStatusOptions) Validate

func (b *BuildUpdateStatusOptions) Validate() *errors.Err

type BuilderConnectOptions

type BuilderConnectOptions struct {
	IP       string           `json:"ip"`
	Port     uint16           `json:"port"`
	TLS      bool             `json:"tls"`
	SSL      *SSL             `json:"ssl"`
	System   SystemInfo       `json:"system"`
	Resource BuilderResources `json:"resource"`
}

func (*BuilderConnectOptions) DecodeAndValidate

func (b *BuilderConnectOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (BuilderConnectOptions) ToJson

func (b BuilderConnectOptions) ToJson() ([]byte, error)

func (BuilderConnectOptions) Validate

func (b BuilderConnectOptions) Validate() *errors.Err

type BuilderCreateManifestOptions

type BuilderCreateManifestOptions struct {
	PID string `json:"pid"`
}

func (*BuilderCreateManifestOptions) DecodeAndValidate

func (b *BuilderCreateManifestOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (BuilderCreateManifestOptions) ToJson

func (b BuilderCreateManifestOptions) ToJson() ([]byte, error)

func (BuilderCreateManifestOptions) Validate

func (b BuilderCreateManifestOptions) Validate() *errors.Err

type BuilderRequest

type BuilderRequest struct{}

func (BuilderRequest) ConnectOptions

func (BuilderRequest) ConnectOptions() *BuilderConnectOptions

func (BuilderRequest) CreateManifestOptions

func (BuilderRequest) CreateManifestOptions() *BuilderCreateManifestOptions

func (BuilderRequest) StatusUpdateOptions

func (BuilderRequest) StatusUpdateOptions() *BuilderStatusUpdateOptions

type BuilderResources

type BuilderResources struct {
	// Builder total containers
	Workers int `json:"workers"`
	// Builder total memory
	RAM int64 `json:"memory"`
	// Builder total cpu
	CPU int64 `json:"cpu"`
	// Builder storage
	Storage int64 `json:"storage"`
}

type BuilderStatusUpdateOptions

type BuilderStatusUpdateOptions struct {
	Allocated BuilderResources `json:"allocated"`
	Capacity  BuilderResources `json:"capacity"`
	Usage     BuilderResources `json:"usage"`
}

func (*BuilderStatusUpdateOptions) DecodeAndValidate

func (b *BuilderStatusUpdateOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (BuilderStatusUpdateOptions) ToJson

func (b BuilderStatusUpdateOptions) ToJson() ([]byte, error)

func (BuilderStatusUpdateOptions) Validate

func (b BuilderStatusUpdateOptions) Validate() *errors.Err

type EventOptions

type EventOptions struct {
	Builds map[string]BuildEvent `json:"builds"`
}

func (*EventOptions) DecodeAndValidate

func (e *EventOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*EventOptions) ToJson

func (e *EventOptions) ToJson() ([]byte, error)

type EventRequest

type EventRequest struct{}

func (EventRequest) EventOptions

func (EventRequest) EventOptions() *EventOptions

type ImageCreateOptions

type ImageCreateOptions struct {
	Name        string `json:"name"`
	Owner       string `json:"owner"`
	Description string `json:"description"`
	Private     bool   `json:"private"`
}

func (*ImageCreateOptions) DecodeAndValidate

func (i *ImageCreateOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*ImageCreateOptions) ToJson

func (i *ImageCreateOptions) ToJson() ([]byte, error)

func (*ImageCreateOptions) Validate

func (i *ImageCreateOptions) Validate() *errors.Err

type ImageInfo

type ImageInfo struct {
	Hash        string `json:"id"`
	Size        int64  `json:"size"`
	VirtualSize int64  `json:"virtual_size"`
}

type ImageRemoveOptions

type ImageRemoveOptions struct {
	Force bool `json:"force"`
}

type ImageRequest

type ImageRequest struct{}

func (ImageRequest) CreateOptions

func (ImageRequest) CreateOptions() *ImageCreateOptions

func (ImageRequest) UpdateOptions

func (ImageRequest) UpdateOptions() *ImageUpdateOptions

type ImageSource

type ImageSource struct {
	Hub    string `json:"hub"`
	Owner  string `json:"owner"`
	Name   string `json:"name"`
	Branch string `json:"branch"`
	Token  string `json:"token"`
}

type ImageUpdateOptions

type ImageUpdateOptions struct {
	Description *string `json:"description"`
	Private     *bool   `json:"private"`
}

func (*ImageUpdateOptions) DecodeAndValidate

func (b *ImageUpdateOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*ImageUpdateOptions) ToJson

func (b *ImageUpdateOptions) ToJson() ([]byte, error)

func (*ImageUpdateOptions) Validate

func (b *ImageUpdateOptions) Validate() *errors.Err

type RegistryRequest

type RegistryRequest struct{}

func (RegistryRequest) UpdateOptions

func (RegistryRequest) UpdateOptions() *RegistryUpdateOptions

type RegistryUpdateOptions

type RegistryUpdateOptions struct {
	AccessToken *string `json:"access_token"`
	AuthServer  *string `json:"auth_server"`
}

func (*RegistryUpdateOptions) DecodeAndValidate

func (r *RegistryUpdateOptions) DecodeAndValidate(reader io.Reader) *errors.Err

func (*RegistryUpdateOptions) ToJson

func (r *RegistryUpdateOptions) ToJson() ([]byte, error)

func (*RegistryUpdateOptions) Validate

func (r *RegistryUpdateOptions) Validate() *errors.Err

type Request

type Request struct{}

func New

func New() *Request

func (Request) Build

func (Request) Build() *BuildRequest

func (Request) Builder

func (Request) Builder() *BuilderRequest

func (Request) Event

func (Request) Event() *EventRequest

func (Request) Image

func (Request) Image() *ImageRequest

func (Request) Registry

func (Request) Registry() *RegistryRequest

type SSL

type SSL struct {
	CA   []byte `json:"ca"`
	Cert []byte `json:"cert"`
	Key  []byte `json:"key"`
}

type SystemInfo

type SystemInfo struct {
	Version      string
	Architecture string
	OSName       string
	OSType       string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL