Documentation
¶
Index ¶
- Constants
- func HashPassword(password string) (string, error)
- func RemoveExpiredAuthorizationCodes() error
- func ValidatePassword(password string) error
- type AuthorizationCode
- type GitWorkspaceSource
- type Group
- type Runner
- type Token
- type User
- type Workspace
- type WorkspaceContainer
- type WorkspaceContainerPort
- type WorkspaceTemplate
- type WorkspaceTemplateVersion
Constants ¶
View Source
const ( WorkspaceConfigSourceGit = "git" WorkspaceConfigSourceTemplate = "template" )
View Source
const WorkspaceStatusDeleting = "deleting"
View Source
const WorkspaceStatusError = "error"
View Source
const WorkspaceStatusRunning = "running"
View Source
const WorkspaceStatusStarting = "starting"
workspace status
View Source
const WorkspaceStatusStopped = "stopped"
View Source
const WorkspaceStatusStopping = "stopping"
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
func RemoveExpiredAuthorizationCodes ¶
func RemoveExpiredAuthorizationCodes() error
remove expired authorization codes
func ValidatePassword ¶
Types ¶
type AuthorizationCode ¶
type AuthorizationCode struct {
ID uint `gorm:"primarykey"`
Code string `gorm:"size:255"`
TokenID uint
Token *Token
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
func GenerateAuthorizationCode ¶
func GenerateAuthorizationCode(token Token, expiration time.Time) (ac AuthorizationCode, err error)
generate authorization code
type GitWorkspaceSource ¶
type GitWorkspaceSource struct {
ID uint `gorm:"primarykey" json:"id"`
RepositoryURL string `gorm:"type:text;not null;" json:"repository_url"`
RefName string `gorm:"size:255; not null;" json:"ref_name"`
ConfigFilePath string `gorm:"type:text;" json:"config_file_relative_path"`
Files string `gorm:"type:text;" json:"-"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (*GitWorkspaceSource) GetConfigFileAbsPath ¶
func (gws *GitWorkspaceSource) GetConfigFileAbsPath() (p string, err error)
type Runner ¶
type Runner struct {
ID uint `gorm:"primarykey" json:"id"`
Name string `gorm:"size:255;unique;not null;" json:"name"`
Token string `gorm:"size:255;unique;not null;" json:"-"`
Port uint `gorm:"default:0;" json:"-"`
Type string `gorm:"size:255;" json:"type"`
Restricted bool `gorm:"default:false;" json:"-"`
AllowedGroups []Group `gorm:"many2many:runner_allowed_groups;" json:"-"`
UsePublicUrl bool `gorm:"default:false;" json:"use_public_url"`
PublicUrl string `gorm:"type:text;" json:"public_url"`
LastContact *time.Time `json:"last_contact"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
type Token ¶
type User ¶
type User struct {
ID uint `gorm:"primarykey" json:"-"`
Email string `gorm:"size:255; unique; not null;" json:"email"`
Password string `gorm:"not null;" json:"-"`
FirstName string `gorm:"size:255;" json:"first_name"`
LastName string `gorm:"size:255;" json:"last_name"`
Groups []Group `gorm:"many2many:user_groups;" json:"groups"`
SshPrivateKey string `gorm:"not null;" json:"-"`
SshPublicKey string `gorm:"not null;" json:"-"`
IsSuperuser bool `gorm:"column:is_superuser; default:false" json:"is_superuser"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (*User) CheckPassword ¶
type Workspace ¶
type Workspace struct {
ID uint `gorm:"primarykey" json:"id"`
Name string `gorm:"size:255; not null;" json:"name"`
UserID uint `json:"-"`
User *User `gorm:"constraint:OnDelete:CASCADE;" json:"user"`
Status string `gorm:"size:30; not null;" json:"status"`
Type string `gorm:"size:255; not null;" json:"type"`
RunnerID uint `json:"-"`
Runner *Runner `gorm:"constraint:OnDelete:CASCADE;" json:"runner"`
ConfigSource string `gorm:"size:20; not null;" json:"config_source"` // template/git
TemplateVersionID *uint `json:"-"`
TemplateVersion *WorkspaceTemplateVersion `gorm:"constraint:OnDelete:CASCADE;" json:"template_version"`
GitSourceID *uint `json:"-"`
GitSource *GitWorkspaceSource `gorm:"constraint:OnDelete:CASCADE;" json:"git_source"`
EnvironmentVariables []string `gorm:"serializer:json" json:"environment_variables"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (*Workspace) AppendLogs ¶
func (*Workspace) GetDefaultEnvironmentVariables ¶
Retrieve list of environement variables to exported by default to workspace This variables are informations related to workspace such as workspace name, owner email, first name and last name
func (*Workspace) GetLogsFilePath ¶
func (*Workspace) RetrieveLogs ¶
type WorkspaceContainer ¶
type WorkspaceContainer struct {
ID uint `gorm:"primarykey" json:"-"`
WorkspaceID uint `json:"-"`
Workspace Workspace `gorm:"constraint:OnDelete:CASCADE;" json:"-"`
ContainerID string `gorm:"size:255" json:"container_id"`
ContainerName string `gorm:"size:255" json:"container_name"`
ContainerImage string `gorm:"size:255" json:"container_image"`
ContainerUserID uint `json:"container_user_id"`
ContainerUserName string `gorm:"size:255" json:"container_user_name"`
AgentLastContact *time.Time `json:"agent_last_contact"`
WorkspacePath string `gorm:"size:255" json:"workspace_path"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
type WorkspaceContainerPort ¶
type WorkspaceContainerPort struct {
ID uint `gorm:"primarykey" json:"-"`
ContainerID uint `json:"-"`
Container WorkspaceContainer `gorm:"constraint:OnDelete:CASCADE;" json:"-"`
ServiceName string `gorm:"size:255; not null;" json:"service_name"`
PortNumber uint `gorm:"not null;" json:"port_number"`
Public bool `gorm:"default:false;" json:"public"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
type WorkspaceTemplate ¶
type WorkspaceTemplateVersion ¶
type WorkspaceTemplateVersion struct {
gorm.Model
ID uint `gorm:"primarykey"`
TemplateID uint
Template *WorkspaceTemplate `gorm:"constraint:OnDelete:CASCADE;not null;"`
Name string `gorm:"size:255;not null;"`
ConfigFilePath string `gorm:"type:text;" json:"config_file_relative_path"`
Files string `gorm:"type:text;not null;"`
}
func (*WorkspaceTemplateVersion) GetConfigFileAbsPath ¶
func (wtv *WorkspaceTemplateVersion) GetConfigFileAbsPath() (p string, err error)
Click to show internal directories.
Click to hide internal directories.