types

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: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BuildStatusQueued    = "queued"
	BuildStatusPreparing = "preparing"
	BuildStatusBuilding  = "building"
	BuildStatusUploading = "uploading"
	BuildStatusSuccess   = "success"
	BuildStatusFailed    = "failed"
	BuildStatusCanceled  = "canceled"
)

Statuses

View Source
const (
	BuildStepFetch  = "fetch"
	BuildStepBuild  = "build"
	BuildStepUpload = "upload"
	BuildStepDone   = "done"
)

STEPS

View Source
const (
	DEFAULT_MIN_WORKERS        = 1
	DEFAULT_MIN_WORKER_CPU     = 50000000 // 0.5 vCPU
	DEFAULT_MIN_WORKER_Storage = 5
	DEFAULT_MIN_WORKER_MEMORY  = 256 * 1024 * 1024
)
View Source
const (
	StorageInsertAction = "insert"
	StorageUpdateAction = "update"
	StorageDeleteAction = "delete"
)
View Source
const (
	ImageDefaultTag             = "latest"
	ImageDefaultDockerfilePath  = "./DockerFile"
	ImageDefaultContextLocation = "/"
)
View Source
const (
	TypeSourceGit      = "git"
	TypeSourceRegistry = "registry"
	TypeSourceImage    = "image"
)
View Source
const BitbucketHost = "bitbucket.org"
View Source
const BitbucketType = "bitbucket"
View Source
const DockerHost = "index.docker.io"
View Source
const EmptyString = ""
View Source
const EmptyStringSlice = "[]"
View Source
const GithubHost = "github.com"
View Source
const GithubType = "github"
View Source
const GitlabHost = "gitlab.com"
View Source
const GitlabType = "gitlab"
View Source
const KindController = "controller"
View Source
const SourceDefaultBranch = "master"
View Source
const StateCancel = "cancel"
View Source
const StateCreated = "created"
View Source
const StateDestroy = "destroy"
View Source
const StateDestroyed = "destroyed"
View Source
const StateError = "error"
View Source
const StateExited = "exited"
View Source
const StateInitialized = "initialized"
View Source
const StateProvision = "provision"
View Source
const StatePull = "pull"
View Source
const StateReady = "ready"
View Source
const StateRunning = "running"
View Source
const StateStarted = "started"
View Source
const StateStarting = "starting"
View Source
const StateStopped = "stopped"
View Source
const StateWarning = "warning"
View Source
const StepInitialized = "initialized"
View Source
const StepPull = "pull"
View Source
const StepReady = "ready"

Variables

This section is empty.

Functions

func NewJwtToken

func NewJwtToken(account string, scope *Scopes, service, issuer, keypath string) (*jwtToken, error)

SERVICE - The name of the token issuer. The issuer inserts this into the token so it must match the value configured for the issuer. ISSUER - The absolute path to the root certificate bundle. This bundle contains the public part of the certificates used to sign authentication tokens. KEYPATH - The absolute path to the root certificate bundle. This bundle contains the public part of the certificates used to sign authentication tokens.

Types

type AccessItem

type AccessItem struct {
	Type    string   `json:"type"`
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

type AccessItems

type AccessItems []AccessItem

type AzureBlobStorage

type AzureBlobStorage struct {
	AccountName    string
	AccountKey     string
	ServiceBaseURL string
	ApiVersion     string
	UseHTTPS       bool
	Emulator       bool
}

type Build

type Build struct {
	Meta   BuildMeta   `json:"meta"`
	Status BuildStatus `json:"status"`
	Spec   BuildSpec   `json:"spec"`
}

func (*Build) MarkAsBuilding

func (b *Build) MarkAsBuilding(step, message string)

func (*Build) MarkAsCanceled

func (b *Build) MarkAsCanceled(step, message string)

func (*Build) MarkAsDone

func (b *Build) MarkAsDone(step, message string)

func (*Build) MarkAsError

func (b *Build) MarkAsError(step, message string)

func (*Build) MarkAsPreparing

func (b *Build) MarkAsPreparing(step, message string)

func (*Build) MarkAsUploading

func (b *Build) MarkAsUploading(step, message string)

func (Build) NewBuildManifest

func (b Build) NewBuildManifest() *Task

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 BuildConfig

type BuildConfig struct {
	Dockerfile string   `json:"dockerfile"`
	Context    string   `json:"context"`
	Workdir    string   `json:"workdir"`
	EnvVars    []string `json:"env"`
	Command    string   `json:"command"`
}

type BuildCreateOptions

type BuildCreateOptions struct {
	Source Source `json:"source"`
	Image  struct {
		ID    string `json:"id"`
		Owner string `json:"owner"`
		Name  string `json:"name"`
		Tag   string `json:"tag"`
		Auth  string `json:"auth"`
	} `json:"source"`
	Spec struct {
		DockerFile string   `json:"dockerfile"`
		Context    string   `json:"context"`
		Command    string   `json:"command"`
		Workdir    string   `json:"workdir"`
		EnvVars    []string `json:"environments"`
	}
	Labels map[string]string `json:"labels"`
}

type BuildImage

type BuildImage struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Owner string `json:"owner"`
	Tag   string `json:"tag"`
	Hash  string `json:"hash"`
	Auth  string `json:"auth"`
}

type BuildInfo

type BuildInfo struct {
	ImageHash string `json:"image_hash"`
	Size      int64  `json:"size"`
}

type BuildList

type BuildList struct {
	Total int64    `json:"total"`
	Page  int64    `json:"page"`
	Limit int64    `json:"limit"`
	Items []*Build `json:"items"`
}

type BuildListOptions

type BuildListOptions struct {
	Active *bool
	Page   *int64
	Limit  *int64
}

type BuildManifestConfig

type BuildManifestConfig struct {
	BuildConfig
}

type BuildManifestImage

type BuildManifestImage struct {
	Host  string `json:"host"`
	Name  string `json:"name"`
	Owner string `json:"owner"`
	Tag   string `json:"tag"`
	Auth  string `json:"auth"`
}

type BuildManifestSource

type BuildManifestSource struct {
	Url    string `json:"url"`
	Branch string `json:"branch"`
}

type BuildMeta

type BuildMeta struct {
	Meta
	Number  int64  `json:"number"`
	Builder string `json:"builder"`
}

type BuildSource

type BuildSource struct {
	Source
	Commit *BuildCommit `json:"commit"`
}

type BuildSpec

type BuildSpec struct {
	Image  BuildImage  `json:"image"`
	Source BuildSource `json:"source"`
	Config BuildConfig `json:"config"`
}

type BuildStatus

type BuildStatus struct {
	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 BuildStep

type BuildStep string

type BuildUpdateStatusOptions

type BuildUpdateStatusOptions struct {
	Step     string  `json:"step"`
	Message  string  `json:"message"`
	Error    bool    `json:"error"`
	Canceled bool    `json:"canceled"`
	Size     *int64  `json:"size"`
	Hash     *string `json:"hash"`
}

type Builder

type Builder struct {
	Meta   BuilderMeta   `json:"meta"`
	Status BuilderStatus `json:"status"`
	Spec   BuilderSpec   `json:"spec"`
}

type BuilderCreateOptions

type BuilderCreateOptions struct {
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`
	Port     uint16 `json:"port"`
	Online   bool   `json:"online"`
	TLS      bool   `json:"tls"`
	SSL      *SSL   `json:"ssl"`
}

type BuilderInfo

type BuilderInfo struct {
	Hostname     string `json:"hostname"`
	Version      string `json:"version"`
	Architecture string `json:"architecture"`
	OSName       string `json:"os_name"`
	OSType       string `json:"os_type"`
}

type BuilderMeta

type BuilderMeta struct {
	Meta
	BuilderInfo
}

type BuilderResources

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

type BuilderSpec

type BuilderSpec struct {
	Network BuilderSpecNetwork `json:"network"`
}

type BuilderSpecNetwork

type BuilderSpecNetwork struct {
	IP   string `json:"ip"`
	Port uint16 `json:"port"`
	TLS  bool   `json:"tls"`
	SSL  *SSL   `json:"ssl"`
}

type BuilderStatus

type BuilderStatus struct {
	Insecure bool `json:"insecure"`
	Online   bool `json:"online"`
	TLS      bool `json:"tls"`
	// Builder Capacity
	Capacity BuilderResources `json:"capacity"`
	// Builder Allocated
	Allocated BuilderResources `json:"allocated"`
	// Builder Usage
	Usage BuilderResources `json:"usage"`
}

type BuilderUpdateOptions

type BuilderUpdateOptions struct {
	Hostname  *string           `json:"hostname"`
	IP        *string           `json:"ip"`
	Port      *uint16           `json:"port"`
	Online    *bool             `json:"online"`
	TLS       *bool             `json:"tls"`
	SSL       *SSL              `json:"ssl"`
	Allocated *BuilderResources `json:"allocated"`
	Capacity  *BuilderResources `json:"capacity"`
	Usage     *BuilderResources `json:"usage"`
}

type Event

type Event struct {
	Name    string          `json:"event"`
	Payload json.RawMessage `json:"payload"`
}

type Image

type Image struct {
	Meta    ImageMeta            `json:"meta"`
	Status  ImageStatus          `json:"status"`
	TagList map[string]*ImageTag `json:"tags"`
}

type ImageCreateOptions

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

type ImageListOptions

type ImageListOptions struct {
	Owner string `json:"owner"`
}

type ImageMeta

type ImageMeta struct {
	Meta
	Owner string `json:"owner"`
}

type ImageRemoveOptions

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

type ImageSource

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

type ImageStats

type ImageStats struct {
	// Image stats pulls quantity
	PullsQuantity int64 `json:"pulls_quantity"`
	// Image stats builds quantity
	BuildsQuantity int64 `json:"builds_quantity"`
	// Image stats stars quantity
	StarsQuantity int64 `json:"stars_quantity"`
	// Image stats views quantity
	ViewsQuantity int64 `json:"views_quantity"`
}

type ImageStatus

type ImageStatus struct {
	Stats   ImageStats `json:"stats"`
	Private bool       `json:"private"`
}

type ImageTag

type ImageTag struct {
	ID       string       `json:"id"`
	ImageID  string       `json:"image"`
	Name     string       `json:"name"`
	Tag      string       `json:"tag"`
	Disabled bool         `json:"disable"`
	Private  bool         `json:"private"`
	Spec     ImageTagSpec `json:"spec"`
	Created  time.Time    `json:"created"`
	Updated  time.Time    `json:"updated"`
}

type ImageTagCreateOptions

type ImageTagCreateOptions struct {
	Name string `json:"name"`
}

type ImageTagSpec

type ImageTagSpec struct {
	DockerFile string   `json:"dockerfile"`
	Context    string   `json:"context"`
	Command    string   `json:"command"`
	Workdir    string   `json:"workdir"`
	EnvVars    []string `json:"environments"`
}

type ImageUpdateOptions

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

type Meta

type Meta struct {
	ID string `json:"id,omitempty"`
	// Meta name
	Name string `json:"name,omitempty"`
	// Meta description
	Description string `json:"description,omitempty"`
	// Meta labels
	Labels map[string]string `json:"labels,omitempty"`
	// Meta created time
	Created time.Time `json:"created,omitempty"`
	// Meta updated time
	Updated time.Time `json:"updated,omitempty"`
}

func (*Meta) SetDefault

func (m *Meta) SetDefault()

type Process

type Process struct {
	Hostname string
	PID      int
}

type Registry

type Registry struct {
	Meta   RegistryMeta   `json:"meta"`
	Status RegistryStatus `json:"status"`
}

type RegistryList

type RegistryList []*Registry

type RegistryMap

type RegistryMap map[string]*Registry

type RegistryMeta

type RegistryMeta struct {
	Meta
}

type RegistryResources

type RegistryResources struct {
	// Registry total builders
	Builders int `json:"builders"`
	// Registry total memory
	Memory int64 `json:"memory"`
	// Registry total cpu
	Cpu int `json:"cpu"`
	// Registry storage
	Storage int `json:"storage"`
}

type RegistryStatus

type RegistryStatus struct {
	TLS       bool              `json:"tls"`
	Capacity  RegistryResources `json:"capacity"`
	Allocated RegistryResources `json:"allocated"`
}

type RegistryUser

type RegistryUser struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SSL

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

type Scope

type Scope struct {
	Type      string   `json:"type"`
	Name      string   `json:"name"`
	Namespace string   `json:"namespace"`
	Actions   []string `json:"actions"`
}

type Scopes

type Scopes []*Scope

type Source

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

type SourceJobConfig

type SourceJobConfig struct {
	Hub    string `json:"hub"`
	Owner  string `json:"owner"`
	Name   string `json:"name"`
	Branch string `json:"branch"`
	// Link to source code in tar
	TarUri string `json:"tar_uri"`
	// Directory where source are unpacked (Ex: github => ./owner/repo/ref)
	WorkDir string `json:"dir"`
}

type StorageEvent

type StorageEvent struct {
	Channel   string `json:"channel"`
	Operation string `json:"operation"`
	Entity    string `json:"entity"`
}

type System

type System struct {
	AccessToken   string
	AuthServer    string
	CtrlMaster    string
	CtrlUpdated   *time.Time
	CtrlLastEvent *time.Time
	Created       time.Time
	Updated       time.Time
}

type SystemUpdateControllerLastEventOptions

type SystemUpdateControllerLastEventOptions struct {
	LastEvent time.Time
}

type SystemUpdateControllerOptions

type SystemUpdateControllerOptions struct {
	Hostname string
	Pid      int
}

type SystemUpdateOptions

type SystemUpdateOptions struct {
	AccessToken *string
	AuthServer  *string
}

type Task

type Task struct {
	Meta struct {
		ID string `json:"id"`
	} `json:"meta"`
	Spec struct {
		Source BuildManifestSource `json:"source"`
		Image  BuildManifestImage  `json:"image"`
		Config BuildManifestConfig `json:"config"`
	} `json:"spec"`
}

type VCSBranch

type VCSBranch struct {
	Name       string    `json:"name"`
	LastCommit VCSCommit `json:"commit,omitempty"`
}

type VCSBranchList

type VCSBranchList []VCSBranch

type VCSCommit

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

type VCSRepo

type VCSRepo struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	Private       bool   `json:"private"`
	DefaultBranch string `json:"default_branch"`
}

type VCSRepoList

type VCSRepoList []VCSRepo

Jump to

Keyboard shortcuts

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