Documentation
¶
Index ¶
- Variables
- func IsTolerationEffect(effect string) bool
- func IsTolerationOperator(operator string) bool
- type APIToken
- type AccessLevel
- type Capabilities
- func (c Capabilities) GetAffinities() map[string]interface{}
- func (c Capabilities) GetNodeSelectors() map[string]string
- func (c Capabilities) GetTolerations() []map[string]interface{}
- func (c Capabilities) IsAffinitiesEmpty() bool
- func (c Capabilities) IsNodeSelectorsEmpty() bool
- func (c Capabilities) IsTolerationsEmpty() bool
- func (c Capabilities) Validate() error
- type Member
- type Project
- type Repository
- type RepositoryAuthMethod
- type RepositoryType
- type Runtime
- type SSHKey
- type TaintEffect
- type TolerationOperator
- type ToolUrls
- type User
- type UserActivity
- type UserActivityType
- type UserActivityVar
Constants ¶
This section is empty.
Variables ¶
var ( ErrProjectNotFound = errors.New("project not found") ErrUserNotFound = errors.New("user not found") ErrDuplicatedUser = errors.New("user is duplicated") ErrNotImplemented = fmt.Errorf("not implemented") ErrInvalidRepoType = fmt.Errorf("invalid repo type") ErrRuntimeNotFound = fmt.Errorf("runtime not found") ErrNoRunningRuntime = fmt.Errorf("no running runtime") ErrCapabilitiesNotFound = errors.New("capabilities not found") ErrCapabilitiesNotValid = errors.New("capabilities not valid") ErrCapabilitiesNoParameters = errors.New("capabilities must contain one of these values: nodeSelector, toleration, affinities") ErrCapabilitiesNoName = errors.New("capabilities must have a name") ErrCapabilitiesNoKey = errors.New("toleration has no key assigned") ErrCapabilitiesNoOperator = errors.New("toleration has no operator assigned") ErrCapabilitiesInvalidOperator = errors.New("the following value is not a valid toleration operator") ErrCapabilitiesNoValue = errors.New("toleration has no value assigned while operator being 'equal'") ErrCapabilitiesHasValue = errors.New("toleration has a value assigned while operator being 'exists'") ErrCapabilitiesNoEffect = errors.New("toleration has no effect assigned") ErrCapabilitiesInvalidEffect = errors.New("the following value is not a valid toleration effect") ErrCapabilitiesInvalidSeconds = errors.New("the following value is not a valid duration for toleration seconds") )
Functions ¶
func IsTolerationEffect ¶
func IsTolerationOperator ¶
Types ¶
type AccessLevel ¶
type AccessLevel string
AccessLevel is an enum for access levels.
const ( AccessLevelViewer AccessLevel = "VIEWER" AccessLevelManager AccessLevel = "MANAGER" AccessLevelAdmin AccessLevel = "ADMIN" )
func (AccessLevel) IsValid ¶
func (e AccessLevel) IsValid() bool
IsValid checks if the type is valid.
func (AccessLevel) String ¶
func (e AccessLevel) String() string
String implements the fmt.Stringer interface.
type Capabilities ¶
type Capabilities struct { ID string `bson:"_id"` Name string `bson:"name"` Default bool `bson:"default"` NodeSelectors map[string]string `bson:"node_selectors"` Tolerations []map[string]interface{} `bson:"tolerations"` Affinities map[string]interface{} `bson:"affinities"` }
Capabilities entity definition.
func (Capabilities) GetAffinities ¶
func (c Capabilities) GetAffinities() map[string]interface{}
func (Capabilities) GetNodeSelectors ¶
func (c Capabilities) GetNodeSelectors() map[string]string
func (Capabilities) GetTolerations ¶
func (c Capabilities) GetTolerations() []map[string]interface{}
func (Capabilities) IsAffinitiesEmpty ¶
func (c Capabilities) IsAffinitiesEmpty() bool
func (Capabilities) IsNodeSelectorsEmpty ¶
func (c Capabilities) IsNodeSelectorsEmpty() bool
func (Capabilities) IsTolerationsEmpty ¶
func (c Capabilities) IsTolerationsEmpty() bool
func (Capabilities) Validate ¶
func (c Capabilities) Validate() error
type Member ¶
type Member struct { UserID string AccessLevel AccessLevel AddedDate time.Time }
Member entity definition.
type Project ¶
type Project struct { ID string Name string Description string CreationDate time.Time LastActivationDate string Favorite bool Archived bool Error *string Repository Repository Members []Member }
Project entity definition.
func NewProject ¶
NewProject is a constructor function.
type Repository ¶
type Repository struct { Type RepositoryType ExternalRepoURL string RepoName string Error *string AuthMethod RepositoryAuthMethod }
Repository entity definition.
type RepositoryAuthMethod ¶
type RepositoryAuthMethod string
RepositoryAuthMethod is an enum for repository authentication method.
const ( // RepositoryAuthPassword authentication method. RepositoryAuthPassword RepositoryAuthMethod = "PASSWORD" // RepositoryAuthToken authentication method. RepositoryAuthToken RepositoryAuthMethod = "TOKEN" )
func (RepositoryAuthMethod) IsValid ¶
func (e RepositoryAuthMethod) IsValid() bool
IsValid checks if the auth method is valid.
func (RepositoryAuthMethod) String ¶
func (e RepositoryAuthMethod) String() string
String implements the fmt.Stringer interface.
type RepositoryType ¶
type RepositoryType string
RepositoryType is an enum for repository types.
const ( // RepositoryTypeInternal repository type. RepositoryTypeInternal RepositoryType = "INTERNAL" // RepositoryTypeExternal repository type. RepositoryTypeExternal RepositoryType = "EXTERNAL" )
func (RepositoryType) IsValid ¶
func (e RepositoryType) IsValid() bool
IsValid checks if the type is valid.
func (RepositoryType) String ¶
func (e RepositoryType) String() string
String implements the fmt.Stringer interface.
type Runtime ¶
type Runtime struct { ID string Name string Desc string Labels []string DockerImage string DockerTag string RuntimePod string }
Runtime entity definition.
func NewRuntime ¶
NewRuntime is a constructor function.
type TaintEffect ¶
type TaintEffect string
const ( TaintEffectNoSchedule TaintEffect = "NoSchedule" TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" TaintEffectNoExecute TaintEffect = "NoExecute" )
type TolerationOperator ¶
type TolerationOperator string
const ( TolerationOpExists TolerationOperator = "Exists" TolerationOpEqual TolerationOperator = "Equal" )
type ToolUrls ¶
type ToolUrls struct { KnowledgeGalaxy string `json:"knowledgeGalaxy"` Gitea string `json:"gitea"` Filebrowser string `json:"filebrowser"` VSCode string `json:"vscode"` Drone string `json:"drone"` MLFlow string `json:"mlflow"` }
ToolUrls entity definition.
type User ¶
type User struct { ID string Email string Username string Deleted bool CreationDate time.Time AccessLevel AccessLevel SSHKey SSHKey LastActivity *time.Time APITokens []APIToken }
User entity definition.
func (User) UsernameSlug ¶
type UserActivity ¶
type UserActivity struct { Date time.Time `bson:"date"` UserID string `bson:"userId"` Type UserActivityType `bson:"type"` Vars []UserActivityVar `bson:"vars"` }
func NewUserActivity ¶
func NewUserActivity( date time.Time, userID string, activityType UserActivityType, vars []UserActivityVar, ) UserActivity
type UserActivityType ¶
type UserActivityType string
const (
UserActivityTypeDeleteProject UserActivityType = "DELETE_PROJECT"
)
func (UserActivityType) IsValid ¶
func (e UserActivityType) IsValid() bool
func (UserActivityType) String ¶
func (e UserActivityType) String() string
type UserActivityVar ¶
func NewActivityVarsDeleteRepo ¶
func NewActivityVarsDeleteRepo(projectID, minioBackupBucket string) []UserActivityVar