types

package
v0.0.0-...-690eaa8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2017 The Elasticshift Authors.

Index

Constants

View Source
const (
	ReadOnly int = iota + 1
	ReadWrite
)
View Source
const (
	BuildStatusWaiting   = "WAITING"
	BuildStatusPreparing = "PREPARING"
	BuildStatusRunning   = "RUNNING"
	BuildStatusSuccess   = "SUCCESS"
	BuildStatusFailed    = "FAILED"
	BuildStatusCancel    = "CANCELLED"
	BuildStatusStuck     = "STUCK"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	ID                bson.ObjectId `json:"id" bson:"_id,omitempty"`
	RepositoryID      string        `json:"repository_id" bson:"repository_id"`
	VcsID             string        `json:"vcs_id" bson:"vcs_id"`
	Log               []Log         `json:"-" bson:"log"`
	LogType           string        `json:"-" bson:"log_type"`
	TriggeredBy       string        `json:"triggered_by" bson:"triggered_by"`
	Branch            string        `json:"branch" bson:"branch"`
	CloneURL          string        `json:"clone_url" bson:"clone_url"`
	Language          string        `json:"language" bson:"language"`
	Team              string        `json:"team" bson:"team"`
	ContainerEngineID string        `json:"-" bson:"container_engine_id"`
	StorageID         string        `json:"-" bson:"storage_id"`
	StoragePath       string        `json:"-" bson:"storage_path"`
	Privatekey        string        `json:"-" bson:"private_key,omitempty"`
	Source            string        `json:"source" bson:"source"`
	SubBuilds         []SubBuild    `json:"sub_builds" bson:"sub_builds,omitempty"`
}

type BuildContainer

type BuildContainer struct {
	ID string
}

type BuildList

type BuildList struct {
	Nodes []Build `json:"nodes"`
	Count int     `json:"count"`
}

type BuildStatus

type BuildStatus int

//go:generate stringer -type=BuildStatus

func (BuildStatus) String

func (i BuildStatus) String() string

type Client

type Client struct {
	ID           string   `bson:"_id,omitempty"`
	Secret       string   `bson:"secret"`
	Name         string   `bson:"name"`
	RedirectURIs []string `bson:"redirect_uris"`
	TrustedPeers []string `bson:"trusted_peers"`
	Public       bool     `bson:"public"`
	LogoURL      string   `bson:"logo_url"`
}

Client ..

type Container

type Container struct {
	ID              bson.ObjectId   `json:"id" bson:"_id,omitempty"`
	BuildID         string          `json:"build_id" bson:"build_id"`
	RepositoryID    string          `json:"repository_id" bson:"repository_id"`
	ContainerID     string          `json:"container_id" bson:"container_id"`
	VcsID           string          `json:"vcs_id" bson:"vcs_id"`
	OrchestrationID string          `json:"orchestration_id" bson:"orchestration_id"`
	Image           string          `json:"image" bson:"image"`
	StartedAt       time.Time       `json:"started_at" bson:"started_at"`
	StoppedAt       time.Time       `json:"stopped_at" bson:"stopped_at"`
	Duration        string          `json:"duration" bson:"duration"`
	Kind            string          `json:"kind" bson:"kind"`
	Status          ContainerStatus `json:"status" bson:"status"`
}

type ContainerEngine

type ContainerEngine struct {
	ID           bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name         string        `json:"name" bson:"name"`
	Provider     int           `json:"provider" bson:"provider"`
	Kind         int           `json:"kind" bson:"kind"`
	Host         string        `json:"host" bson:"host,omitempty"`
	Certificate  string        `json:"certificate" bson:"certificate,omitempty"`
	Token        string        `json:"token" bson:"token,omitempty"`
	InternalType int           `json:"-" bson:"internal_type"`
	Team         string        `json:"team" bson:"team"`
	Version      string        `json:"version" bson:"version,omitempty"`
	KubeFile     KubeConfig    `json:"kube_config" bson:"kube_config,omitempty"`
}

type ContainerEngineList

type ContainerEngineList struct {
	Nodes []ContainerEngine `json:"nodes"`
	Count int               `json:"count"`
}

type ContainerList

type ContainerList struct {
	Nodes []Container `json:"nodes"`
	Count int         `json:"count"`
}

type ContainerStatus

type ContainerStatus int
const (
	CS_RUNNING ContainerStatus = iota + 1
	CS_STARTED
	CS_STOPPED
)

func (*ContainerStatus) SetBSON

func (b *ContainerStatus) SetBSON(raw bson.Raw) error

func (ContainerStatus) String

func (i ContainerStatus) String() string

type Default

type Default struct {
	ID                bson.ObjectId     `json:"id" bson:"_id,omitempty"`
	Kind              int               `json:"kind" bson:"kind"`
	ReferenceID       string            `json:"reference_id" bson:"reference_id"`
	ContainerEngineID string            `json:"container_engine_id" bson:"container_engine_id,omitempty"`
	StorageID         string            `json:"storage_id" bson:"storage_id,omitempty"`
	Languages         map[string]string `json:"languages" bson:"languages,omitempty"`
}

type GenericSysConf

type GenericSysConf struct {
	ID    bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name  string        `json:"name" bson:"name"`
	Kind  string        `json:"kind" bson:"kind"`
	Value string        `json:"value" bson:"value"`
}

GenericConf ..

type Infrastructure

type Infrastructure struct {
	ID          bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name        string        `json:"name" bson:"name"`
	Description string        `json:"description" bson:"description,omitempty"`
	Kind        string        `json:"kind" bson:"kind"`
	Private     bool          `json:"private" bson:"private"`
	Code        string        `json:"code" bson:"code"`
	Team        string        `json:"team" bson:"team"`
}

type InfrastructureList

type InfrastructureList struct {
	Nodes []Infrastructure `json:"nodes"`
	Count int              `json:"count"`
}

type KubeConfig

type KubeConfig []byte

func (KubeConfig) GetBSON

func (f KubeConfig) GetBSON() (interface{}, error)

func (*KubeConfig) SetBSON

func (f *KubeConfig) SetBSON(raw bson.Raw) error

type Log

type Log struct {
	Time time.Time `json:"time" bson:"time"`
	Data string    `json:"data" bson:"data"`
}

type Metadata

type Metadata struct {

	// general
	Kind        int    `json:"-" bson:"kind"`
	ContainerID string `json:"-" bson:"container_id"`

	// Kubernetes
	PodName string `json:"-" bson:"pod_name"`
}

type MinioStorage

type MinioStorage struct {
	Host        string `json:"host" bson:"host"`
	Certificate string `json:"certificate" bson:"certificate"`
	AccessKey   string `json:"access_key" bson:"access_key"`
	SecretKey   string `json:"secret_key" bson:"secret_key"`
	BucketName  string `json:"bucket_name" bson:"bucket_name,omitempty"`
}

type NFSStorage

type NFSStorage struct {
	Server    string `json:"server" bson:"server"`
	Path      string `json:"path" bson:"path"`
	ReadOnly  bool   `json:"readonly" bson:"read_only"`
	MountPath string `json:"mount_path" bson:"mount_path"`
}

type NFSVolumeSysConf

type NFSVolumeSysConf struct {
	ID         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name       string        `json:"name" bson:"name"`
	Kind       string        `bson:"kind" bson:"kind,omitempty"`
	Server     string        `json:"server" bson:"server"`
	Path       string        `json:"path" bson:"path"`
	AccessMode int           `json:"access_mode" bson:"access_mode"`
}

type Plugin

type Plugin struct {
	ID             bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name           string        `json:"name" bson:"name"`
	Description    string        `json:"description" bson:"description"`
	Language       string        `json:"language" bson:"language"`
	Version        string        `json:"version" bson:"version"`
	Author         string        `json:"author" bson:"author"`
	Email          string        `json:"email" bson:"email"`
	SourceURL      string        `json:"source_url" bson:"source_url,omitempty"`
	Readme         string        `json:"readme" bson:"readme"`
	UsedTeamCount  int64         `json:"used_team_count" bson:"used_team_count"`
	UsedReposCount int64         `json:"used_build_count" bson:"used_build_count"`
	IconURL        string        `json:"icon_url" bson:"icon_url"`
	Ratings        string        `json:"ratings" bson:"ratings"`
	Team           string        `json:"team" bson:"team"`
	Path           string        `json:"path" bson:"path"`
}

type PluginList

type PluginList struct {
	Nodes []Plugin `json:"nodes"`
	Count int      `json:"count"`
}

type Property

type Property struct {
	Key   string `json:"key" bson:"key"`
	Value string `json:"value" bson:"value"`
}

type Repository

type Repository struct {
	ID            bson.ObjectId `bson:"_id,omitempty"`
	RepoID        string        `json:"repo_id" bson:"repo_id"`
	VcsID         string        `json:"vcs_id" bson:"vcs_id"`
	Name          string        `json:"name" bson:"name,omitempty"`
	Private       bool          `json:"private" bson:"private,omitempty"`
	Link          string        `json:"link" bson:"link,omitempty"`
	Description   string        `json:"description" bson:"description,omitempty"`
	Fork          bool          `json:"fork" bson:"fork,omitempty"`
	DefaultBranch string        `json:"default_branch" bson:"default_branch,omitempty"`
	CloneURL      string        `json:"clone_url" bson:"clone_url"`
	Language      string        `json:"language" bson:"language,omitempty"`
	Identifier    string        `json:"-" bson:"identifier"`
	Source        string        `json:"source" bson:"source"`
	Team          string        `json:"-" bson:"team"`
}

Repository .. Represents as vcs repositories or projects

type RepositoryList

type RepositoryList struct {
	Nodes []Repository `json:"nodes"`
	Count int          `json:"count"`
}

type Secret

type Secret struct {
	ID            bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name          string        `json:"name" bson:"name"`
	Kind          string        `json:"kind" bson:"kind"`
	ReferenceKind string        `json:"reference_kind" bson:"reference_kind"`
	ReferenceID   string        `json:"reference_id" bson:"reference_id"`
	Value         string        `json:"value" bson:"value"`
	InternalType  string        `json:"-" bson:"internal_type"`
	KeyID         string        `json:"-" bson:"key_id"`
	TeamID        string        `json:"team_id" bson:"team_id"`
}

type SecretList

type SecretList struct {
	Nodes []Secret `json:"nodes"`
	Count int      `json:"count"`
}

type Shiftfile

type Shiftfile struct {
	ID          bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name        string        `json:"name" bson:"name"`
	Description string        `json:"description" bson:"description"`
	File        ShiftfileType `json:"file" bson:"file"`
	UsedByTeams int64         `json:"used_by_teams" bson:"used_by_teams"`
	UsedByRepos int64         `json:"used_by_repos" bson:"used_by_repos"`
	TeamID      string        `json:"team_id" bson:"team_id"`
	Ratings     string        `json:"ratings" bson:"ratings"`
}

type ShiftfileList

type ShiftfileList struct {
	Nodes []Shiftfile `json:"nodes"`
	Count int         `json:"count"`
}

type ShiftfileType

type ShiftfileType []byte

func (ShiftfileType) GetBSON

func (f ShiftfileType) GetBSON() (interface{}, error)

func (*ShiftfileType) SetBSON

func (f *ShiftfileType) SetBSON(raw bson.Raw) error

type Storage

type Storage struct {
	ID            bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name          string        `json:"name" bson:"name"`
	Provider      int           `json:"provider" bson:"provider"`
	Kind          int           `json:"kind" bson:"kind"`
	InternalType  int           `json:"-" bson:"internal_type"`
	Team          string        `json:"team" bson:"team"`
	Status        string        `json:"status" bson:"status,omitempty"`
	Reason        string        `json:"reason" bson:"reason,omitempty"`
	WorkerPath    string        `json:"worker_path" bson:"worker_path,omitempty"`
	StorageSource `json:"storage_source" bson:"storage_source"`
}

type StorageList

type StorageList struct {
	Nodes []Storage `json:"nodes"`
	Count int       `json:"count"`
}

type StorageMetadata

type StorageMetadata struct {
	TeamID       string
	RepositoryID string
	BuildID      string
	SubBuildID   string
	Branch       string
	Path         string
}

type StorageSource

type StorageSource struct {
	NFS   *NFSStorage   `json:"nfs" bson:"nfs,omitempty"`
	Minio *MinioStorage `json:"minio" bson:"minio,omitempty"`
}

type SubBuild

type SubBuild struct {
	ID        string    `json:"id" bson:"id"`
	Image     string    `json:"image" bson:"image"`
	Status    string    `json:"status" bson:"status"`
	Graph     string    `json:"graph" bson:"graph,omitempty"`
	Reason    string    `json:"reason" bson:"reason,omitempty"`
	Duration  string    `json:"duration" bson:"duration,omitempty"`
	StartedAt time.Time `json:"started_at" bson:"started_at,omitempty"`
	EndedAt   time.Time `json:"ended_at" bson:"ended_at,omitempty"`
	Metadata  *Metadata `json:"-" bson:"metadata,omitempty"`
}

type Team

type Team struct {
	ID         bson.ObjectId `bson:"_id,omitempty"`
	Name       string        `bson:"name"`
	Display    string        `bson:"display,omitempty"`
	Accounts   []VCS         `bson:"accounts"`
	KubeConfig KubeConfig    `json:"-" bson:"kube_config"`
}

Team ..

type User

type User struct {
	ID            bson.ObjectId `bson:"_id,omitempty"`
	Fullname      string        `bson:"fullname"`
	Username      string        `bson:"username"`
	Email         string        `bson:"email"`
	Password      string        `bson:"password"`
	Locked        bool          `bson:"locked"`
	Active        bool          `bson:"active"`
	BadAttempt    int8          `bson:"bad_attempt"`
	EmailVefified bool          `bson:"email_verified"`
	Scope         []string      `bson:"scope"`
	Team          string        `bson:"team"`
}

User ..

type VCS

type VCS struct {
	ID           string    `json:"id" bson:"id,omitempty"`
	Name         string    `json:"name" bson:"name,omitempty"`
	Kind         string    `json:"kind" bson:"kind,omitempty"`
	Link         string    `json:"link" bson:"link,omitempty"`
	Source       string    `json:"source" bson:"source"`
	OwnerType    string    `json:"owner_type" bson:"owner_type,omitempty"`
	AvatarURL    string    `json:"avatar" bson:"avatar,omitempty"`
	AccessCode   string    `json:"access_code" bson:"access_code,omitempty"`
	AccessToken  string    `json:"access_token" bson:"access_token,omitempty"`
	RefreshToken string    `json:"refresh_token" bson:"refresh_token,omitempty"`
	TokenExpiry  time.Time `json:"token_expiry" bson:"token_expiry,omitempty"`
	SecretID     string    `json:"-" bson:"secret_id"`
}

VCS contains the information common amongst most OAuth and OAuth2 providers. All of the "raw" datafrom the provider can be found in the `RawData` field.

type VCSList

type VCSList struct {
	Nodes []VCS `json:"nodes"`
	Count int   `json:"count"`
}

type VCSSysConf

type VCSSysConf struct {
	// common fields for any sys config
	ID   bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name string        `bson:"name,omitempty" json:"name"`
	Kind string        `bson:"kind,omitempty" json:"kind"`

	Key         string `bson:"key,omitempty" json:"key"`
	Secret      string `bson:"secret,omitempty" json:"secret"`
	CallbackURL string `bson:"callback_url,omitempty" json:"callback_url"`
	HookURL     string `bson:"hook_url,omitempty" json:"hook_url"`
}

VCSSysConf ..(sysconf)

Jump to

Keyboard shortcuts

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