models

package
v0.0.0-...-6c1e425 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationCost

type ApplicationCost struct {
	// Name of the application
	//
	// required: true
	// example: radix-canary-golang
	Name string `json:"name"`
	// Owner of the application (email). Can be a single person or a shared group email.
	//
	// required: false
	Owner string `json:"owner"`

	// Creator of the application.
	//
	// required: false
	Creator string `json:"creator"`

	// WBS for the application.
	//
	// required: false
	WBS string `json:"wbs"`

	// CostPercentageByCPU is cost percentage by CPU for the application.
	//
	// required: false
	CostPercentageByCPU float64 `json:"costPercentageByCpu"`

	// CostPercentageByMemory is cost percentage by memory for the application
	//
	// required: false
	CostPercentageByMemory float64 `json:"costPercentageByMemory"`

	// Comment regarding cost
	//
	// required: false
	Comment string `json:"comment"`

	// Cost
	//
	// required: true
	Cost float64 `json:"cost"`

	// Cost currency
	//
	// required: true
	Currency string `json:"currency"`
}

ApplicationCost details of one application cost swagger:model ApplicationCost

type ApplicationCostSet

type ApplicationCostSet struct {

	// ApplicationCostSet period started From
	//
	// required: true
	// swagger:strfmt date
	From time.Time `json:"from"`

	// ApplicationCostSet period continued To
	//
	// required: true
	// swagger:strfmt date
	To time.Time `json:"to"`

	// ApplicationCosts with costs.
	//
	// required: true
	ApplicationCosts []ApplicationCost `json:"applicationCosts"`

	// TotalRequestedCPU within the period.
	//
	// required: false
	TotalRequestedCPU int `json:"totalRequestedCpu"`

	// TotalRequestedMemory within the period.
	//
	// required: false
	TotalRequestedMemory int `json:"totalRequestedMemory"`
}

ApplicationCostSet details of application cost set swagger:model ApplicationCostSet

func (*ApplicationCostSet) FilterApplicationCostBy

func (cost *ApplicationCostSet) FilterApplicationCostBy(appName string)

FilterApplicationCostBy filters by app name

func (ApplicationCostSet) GetCostBy

func (cost ApplicationCostSet) GetCostBy(appName string) *ApplicationCost

GetCostBy returns application by appName

type ContainerDto

type ContainerDto struct {
	ContainerId            string    `gorm:"column:container_id;type:varchar(253);primaryKey;<-:false"`
	ContainerName          string    `gorm:"column:container_name;type:varchar(253);<-:false"`
	PodName                string    `gorm:"column:pod_name;type:varchar(253);<-:false"`
	ApplicationName        string    `gorm:"column:application_name;type:varchar(253);<-:false"`
	EnvironmentName        string    `gorm:"column:environment_name;type:varchar(253);<-:false"`
	ComponentName          string    `gorm:"column:component_name;type:varchar(253);<-:false"`
	WBS                    string    `gorm:"column:wbs;type:varchar(253);<-:false"`
	StartedAt              time.Time `gorm:"column:started_at;type:datetimeoffset(0);<-:false"`
	LastKnownRunningAt     time.Time `gorm:"column:last_known_running_at;type:datetimeoffset(0);<-:false"`
	CpuRequestedMillicores int64     `gorm:"column:cpu_request_millicores;type:bigint;<-:false"`
	MemoryRequestedBytes   int64     `gorm:"column:memory_request_bytes;type:bigint;<-:false"`
	NodeId                 int32     `gorm:"column:node_id;type:int;<-:false"`
	Node                   *NodeDto  `gorm:"foreignKey:NodeId"`
}

func (ContainerDto) TableName

func (ContainerDto) TableName() string

type DBCredentials

type DBCredentials struct {
	Server   string
	Port     int
	Database string
}

DBCredentials hold credentials for database

type Env

type Env struct {
	APIEnvironment      string
	ClusterName         string
	DNSZone             string
	UseLocalRadixApi    bool
	UseProfiler         bool
	DbCredentials       *DBCredentials
	Whitelist           *Whitelist
	Cluster             string
	OidcIssuer          string
	OidcAudience        string
	OidcAllowedAdGroups []string
}

Env instance variables

func NewEnv

func NewEnv() (*Env, error)

NewEnv Constructor

func (*Env) GetRadixAPISchemes

func (env *Env) GetRadixAPISchemes() []string

func (*Env) GetRadixAPIURL

func (env *Env) GetRadixAPIURL() string

type NodeDto

type NodeDto struct {
	Id         int32        `gorm:"column:id;type:int;primaryKey;<-:false"`
	Name       string       `gorm:"column:name;type:varchar(253);<-:false"`
	NodePoolId *int32       `gorm:"column:pool_id;type:int;<-:false"`
	NodePool   *NodePoolDto `gorm:"foreignKey:NodePoolId;<-:false"`
}

func (NodeDto) TableName

func (NodeDto) TableName() string

type NodePoolCostDto

type NodePoolCostDto struct {
	Id         int32       `gorm:"column:id;type:int;primaryKey;<-:false"`
	Cost       float64     `gorm:"column:cost;type:int;<-:false"`
	Currency   string      `gorm:"column:cost_currency;type:char(3);<-:false"`
	FromDate   time.Time   `gorm:"column:from_date;type:datetimeoffset(0);<-:false"`
	ToDate     time.Time   `gorm:"column:to_date;type:datetimeoffset(0);<-:false"`
	NodePoolId int32       `gorm:"column:pool_id;type:int;<-:false"`
	NodePool   NodePoolDto `gorm:"foreignKey:NodePoolId;<-:false"`
}

func (NodePoolCostDto) TableName

func (NodePoolCostDto) TableName() string

type NodePoolDto

type NodePoolDto struct {
	Id   int32  `gorm:"column:id;type:int;primaryKey;<-:false"`
	Name string `gorm:"column:name;type:varchar(253);<-:false"`
}

func (NodePoolDto) TableName

func (NodePoolDto) TableName() string

type Whitelist

type Whitelist struct {
	// List is the list of apps
	//
	// required: true
	List []string `json:"whiteList"`
}

Whitelist contains list of apps that should not be part of cost distribution

Jump to

Keyboard shortcuts

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