model

package
v0.0.0-...-5b0754e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

//TODO: If our models become sufficiently complex, we should consider separating REST from persistence

Documentation

Index

Constants

View Source
const (
	EnvStarting = "starting"
	EnvRunning  = "running"
	EnvFailed   = "failed"
	EnvDeleted  = "deleted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEnvironment

type BaseEnvironment struct {
	Id          uint            `json:"id" gorm:"primaryKey"`
	OwnerId     *uint           `json:"ownerID" gorm:"foreignKey"`
	Name        string          `json:"name" binding:"required" gorm:"type:varchar(80);uniqueIndex:name_deletedAt"`
	ChartName   string          `json:"chartName" binding:"required,knownchart" gorm:"type:varchar(80)"`
	Status      string          `json:"status" gorm:"type:varchar(20)"`
	ReleaseName string          `json:"releaseName" gorm:"type:varchar(80)"`
	CreatedAt   time.Time       `json:"createdAt"` // UTC
	DeletedAt   gorm.DeletedAt  `json:"deletedAt" gorm:"uniqueIndex:name_deletedAt;default:'0000-00-00';not null"`
	RawValues   json.RawMessage `json:"values" binding:"required" gorm:"column:values"`
}

type Environment

type Environment struct {
	BaseEnvironment
	RequestOverrides map[string]any `json:"-" gorm:"-"`
	Chart            *chart.Chart   `json:"-" gorm:"-"`
}

func (*Environment) AddChart

func (env *Environment) AddChart(chart *chart.Chart)

func (*Environment) IsDeleted

func (env *Environment) IsDeleted() bool

func (*Environment) Persistable

func (env *Environment) Persistable()

func (*Environment) UnmarshalJSON

func (env *Environment) UnmarshalJSON(data []byte) error

func (*Environment) Values

func (env *Environment) Values() map[string]any

type Token

type Token struct {
	Id          uint      `json:"id" gorm:"primaryKey"`
	Description string    `json:"description" binding:"required"`
	CreatedAt   time.Time `json:"createdAt"` // UTC
	EncodedHash string    `json:"-" gorm:"type:varchar(120)"`
}

func (*Token) Persistable

func (tk *Token) Persistable()

type TokenCreationResponse

type TokenCreationResponse struct {
	Token
	Value string `json:"token"`
}

Jump to

Keyboard shortcuts

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