model

package
v0.0.0-...-fe4f5a4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//BuildStepCreate - The first step after build creating
	BuildStepCreate = "create"
	//BuildStepFetch - Fetch sources step
	BuildStepFetch = "fetch"
	//BuildStepBuild - Build executing step
	BuildStepBuild = "build"
	//BuildStepUpload - Upload docker image step
	BuildStepUpload = "upload"
)

Variables

View Source
var (
	ErrUnexpectedSigninMethod = errors.New("UNEXPECTED_SIGNIN_METHD")
	ErrSessionTokenHasNoUID   = errors.New("NO_UID_IN_TOKEN")
	ErrSessionTokenHasNoEXP   = errors.New("NO_EXP_IN_TOKEN")
	ErrSessionTokenHasNoJTI   = errors.New("NO_JTI_IN_TOKEN")
)

Functions

This section is empty.

Types

type Build

type Build struct {
	// Build number, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Build number, incremented automatically
	User string `json:"user" gorethink:"id,omitempty"`
	// Build executing status
	Status BuildStatus `json:"status" gorethink:"status,omitempty"`
	// Build sources used for build
	Source BuildSource `json:"source" gorethink:"source,omitempty"`
	// Build image output information
	Image BuildImage `json:"image" gorethink:"image,omitempty"`
	// Build created time
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Build updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

type BuildImage

type BuildImage struct {
	// Build image repo name
	Repo string `json:"repo" gorethink:"repo,omitempty"`
	// Build image tag name
	Tag string `json:"tag" gorethink:"tag,omitempty"`
	// Build image registry reference
	Registry string `json:"registry" gorethink:"registry,omitempty"`
}

type BuildList

type BuildList []Build

type BuildSource

type BuildSource struct {
	// Build sources hub
	Hub string `json:"hub" gorethink:"hub,omitempty"`
	// Build sources owner
	Owner string `json:"owner" gorethink:"owner,omitempty"`
	// Build sources repo
	Repo string `json:"repo" gorethink:"repo,omitempty"`
	// Build source tag (branch, tag)
	Tag string `json:"tag" gorethink:"tag,omitempty"`
	// Build commit information
	Commit GitSourceCommit `json:"commit" gorethink:"commit,omitempty"`
}

type BuildStatus

type BuildStatus struct {
	// Build current step
	Step BuildStep `json:"step" gorethink:"step,omitempty"`
	// Is build cancelled
	Cancelled bool `json:"cancelled" gorethink:"cancelled,omitempty"`
	// Build executing message
	Message string `json:"message" gorethink:"message,omitempty"`
	// Build error information
	Error string `json:"error" gorethink:"error,omitempty"`
	// Build status updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

type BuildStep

type BuildStep string

type ContainerConfig

type ContainerConfig struct {
	Image      string   `json:"image" yaml:"image"`
	Name       string   `json:"name" yaml:"name"`
	WorkingDir string   `json:"workdir" yaml:"workdir"`
	Command    []string `json:"command" yaml:"command"`
	Args       []string `json:"args" yaml:"args"`
	Env        []EnvVar `json:"env" yaml:"env"`
	Ports      []Port   `json:"ports" yaml:"ports"`
}

type EnvVar

type EnvVar struct {
	Name  string `json:"name" yaml:"name"`
	Value string `json:"value" yaml:"value"`
}

type GitSourceCommit

type GitSourceCommit struct {
	// Git commit information hash
	Commit string `json:"commit" gorethink:"id,omitempty"`
	// Git committer gravatar
	Committer string `json:"committer" gorethink:"id,omitempty"`
	// Git committer email
	Author string `json:"author" gorethink:"id,omitempty"`
	// Git commit message
	Message string `json:"message" gorethink:"id,omitempty"`
}

type Hook

type Hook struct {
	// Hook uuid, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Hook owner
	User string `json:"user" gorethink:"user,omitempty"`
	// Hook token
	Token string `json:"token" gorethink:"token,omitempty"`
	// Hook image to build
	Image string `json:"image" gorethink:"name,omitempty"`
	// Hook service to build images
	Service string `json:"service" gorethink:"name,omitempty"`
	// Hook created time
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Hook updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

type HookList

type HookList []Hook

type Image

type Image struct {
	// Image uuid, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Image user
	User string `json:"user" gorethink:"user,omitempty"`
	// Image name
	Name string `json:"name" gorethink:"name,omitempty"`
	// Image tag lists
	Tags map[string]ImageTag `json:"tags" gorethink:"tags,omitempty"`
	// Image created time
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Image updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

type ImageList

type ImageList []Image

type ImageTag

type ImageTag struct {
}

type Port

type Port struct {
	Name      string `json:"name" yaml:"name"`
	Container int32  `json:"container" yaml:"container"`
	Protocol  string `json:"protocol" yaml:"protocol"`
}

type Profile

type Profile struct {
	FirstName string `json:"first_name" gorethink:"first_name,omitempty"`
	LastName  string `json:"last_name" gorethink:"last_name,omitempty"`
	Company   string `json:"company" gorethink:"company,omitempty"`
}

type Project

type Project struct {
	// Project uuid, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Project user
	User string `json:"user" gorethink:"user,omitempty"`
	// Project name
	Name string `json:"name" gorethink:"name,omitempty"`
	// Project description
	Description string `json:"description" gorethink:"description,omitempty"`
	// Project created time
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Project updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

func (*Project) DrawTable

func (p *Project) DrawTable()

func (*Project) ToJson

func (p *Project) ToJson() ([]byte, *e.Err)

type ProjectList

type ProjectList []Project

func (*ProjectList) DrawTable

func (projects *ProjectList) DrawTable()

func (*ProjectList) ToJson

func (p *ProjectList) ToJson() ([]byte, *e.Err)

type Service

type Service struct {
	// Service uuid, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Service user
	User string `json:"user" gorethink:"user,omitempty"`
	// Service project
	Project string `json:"project" gorethink:"project,omitempty"`
	// Service image
	Image string `json:"image" gorethink:"image,omitempty"`
	// Service name
	Name string `json:"name" gorethink:"name,omitempty"`
	// Service description
	Description string `json:"description" gorethink:"description,omitempty"`
	// Service spec
	Spec *service.Service `json:"spec,omitempty" gorethink:"-"`
	// Service created time
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Service updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

func (*Service) DrawTable

func (s *Service) DrawTable(projectName string)

func (*Service) GetConfig

func (s *Service) GetConfig() *ServiceUpdateConfig

func (*Service) ToJson

func (s *Service) ToJson() ([]byte, *e.Err)

type ServiceList

type ServiceList []Service

func (*ServiceList) DrawTable

func (s *ServiceList) DrawTable(projectName string)

func (*ServiceList) ToJson

func (s *ServiceList) ToJson() ([]byte, *e.Err)

type ServiceUpdateConfig

type ServiceUpdateConfig struct {
	Description string            `json:"description" yaml:"description"`
	Replicas    int32             `json:"scale" yaml:"scale"`
	Containers  []ContainerConfig `json:"containers" yaml:"containers"`
}

func (ServiceUpdateConfig) CreateServiceConfig

func (s ServiceUpdateConfig) CreateServiceConfig() *service.ServiceConfig

type Session

type Session struct {
	Uid      string // session user id
	Oid      string // session organization id
	Username string // session username
	Email    string // session email
}

func NewSession

func NewSession(uid, oid, username, email string) *Session

Generate new Session pointer structure

func (*Session) Decode

func (s *Session) Decode(token string) error

Decode - decode token to session object

func (*Session) Encode

func (s *Session) Encode() (string, error)

Encode - encode session structure to jwt token

type Template

type Template struct {
	Secrets                []v1.Secret                `json:"secrets,omitempty"`
	PersistentVolumes      []v1.PersistentVolume      `json:"persistent_volumes,omitempty"`
	PersistentVolumeClaims []v1.PersistentVolumeClaim `json:"persistent_volume_claims,omitempty"`
	ServiceAccounts        []v1.ServiceAccount        `json:"service_accounts,omitempty"`
	Services               []v1.Service               `json:"services,omitempty"`
	ReplicationControllers []v1.ReplicationController `json:"replication_controllers,omitempty"`
	Pods                   []v1.Pod                   `json:"pods,omitempty"`
	Deployments            []v1beta1.Deployment       `json:"deployments,omitempty"`
	DaemonSets             []v1beta1.DaemonSet        `json:"daemon_sets,omitempty"`
	Jobs                   []v1beta1.Job              `json:"jobs,omitempty"`
	Ingresses              []v1beta1.Ingress          `json:"ingresses,omitempty"`
}

func (*Template) ToJson

func (t *Template) ToJson() ([]byte, *e.Err)

type TemplateList

type TemplateList map[string][]string

func (*TemplateList) DrawTable

func (tpl *TemplateList) DrawTable()

func (*TemplateList) ToJson

func (t *TemplateList) ToJson() ([]byte, *e.Err)

type User

type User struct {
	ID           string    `json:"id" gorethink:"id,omitempty"`
	Username     string    `json:"username" gorethink:"username,omitempty"`
	Email        string    `json:"email" gorethink:"email,omitempty"`
	Gravatar     string    `json:"gravatar" gorethink:"gravatar,omitempty"`
	Balance      float32   `json:"balance" gorethink:"balance,omitempty"`
	Organization bool      `json:"organization" gorethink:"organization,omitempty"`
	Created      time.Time `json:"created" gorethink:"created,omitempty"`
	Updated      time.Time `json:"updated" gorethink:"updated,omitempty"`

	Password string `json:"-" gorethink:"password,omitempty,omitempty"`
	Salt     string `json:"-" gorethink:"salt,omitempty,omitempty"`

	Profile Profile `json:"profile" gorethink:"profile,omitempty"`
}

func (*User) ToJson

func (u *User) ToJson() ([]byte, *e.Err)

func (*User) ValidatePassword

func (u *User) ValidatePassword(password string) *e.Err

Validation methods

type Volume

type Volume struct {
	// Volume uuid, incremented automatically
	ID string `json:"id" gorethink:"id,omitempty"`
	// Volume uuid, incremented automatically
	Project string `json:"project" gorethink:"project,omitempty"`
	// Volume user
	User string `json:"user" gorethink:"user,omitempty"`
	// Volume name
	Name string `json:"name" gorethink:"name,omitempty"`
	// Volume tag lists
	Created time.Time `json:"created" gorethink:"created,omitempty"`
	// Volume updated time
	Updated time.Time `json:"updated" gorethink:"updated,omitempty"`
}

type VolumeList

type VolumeList []Volume

Jump to

Keyboard shortcuts

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