entity

package
v0.0.0-...-3439342 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AffinityMode_Required  = "required"
	AffinityMode_Preferred = "preferred"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessType

type AccessType string
const (
	Access_Type_ClusterIP    AccessType = "ClusterIP"
	Access_Type_LoadBalancer AccessType = "LoadBalancer"
)

type Affinity

type Affinity struct {
	Project         string               `json:"project"`
	Env             string               `json:"env"`
	Name            string               `json:"name"`
	NodeAffinity    []AffinityTerm       `json:"node_affinity"`
	PodAffinity     []AffinityTerm       `json:"pod_affinity"`
	PodAntiAffinity []AffinityTerm       `json:"pod_anti_affinity"`
	Tolerations     []AffinityToleration `json:"tolerations"`
	CreatedBy       int                  `json:"created_by"`
}

func (Affinity) DefaultAffinity

func (Affinity) DefaultAffinity(env, name string) *Affinity

type AffinityMode

type AffinityMode string

type AffinityOperator

type AffinityOperator string
const (
	AffinityOperator_In           AffinityOperator = "In"
	AffinityOperator_NotIn        AffinityOperator = "NotIn"
	AffinityOperator_Exists       AffinityOperator = "Exists"
	AffinityOperator_DoesNotExist AffinityOperator = "DoesNotExist"
	AffinityOperator_Gt           AffinityOperator = "Gt"
	AffinityOperator_Lt           AffinityOperator = "Lt"
)

type AffinityTemplate

type AffinityTemplate struct {
	TemplateName    string               `json:"template_name"`
	NodeAffinity    []AffinityTerm       `json:"node_affinity"`
	PodAffinity     []AffinityTerm       `json:"pod_affinity"`
	PodAntiAffinity []AffinityTerm       `json:"pod_anti_affinity"`
	Tolerations     []AffinityToleration `json:"tolerations"`
}

func (AffinityTemplate) DefaultAffinityTemplate

func (AffinityTemplate) DefaultAffinityTemplate() *AffinityTemplate

func (*AffinityTemplate) ToAffinityEntity

func (at *AffinityTemplate) ToAffinityEntity(env, name string) *Affinity

type AffinityTerm

type AffinityTerm struct {
	Mode        AffinityMode     `json:"mode"`
	Key         string           `json:"key"`
	Operator    AffinityOperator `json:"operator"`
	Values      []string         `json:"values"`
	Weight      int              `json:"weight"`
	TopologyKey string           `json:"topology_key"`
}

type AffinityToleration

type AffinityToleration struct {
	Key      string `json:"key"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
	Effect   string `json:"effect"`
}

type Deployment

type Deployment struct {
	Id               int              `json:"id"`
	Project          string           `json:"project"`
	Env              string           `json:"env"`
	Name             string           `json:"name"`
	DeploymentImage  Image            `json:"image_detail"`
	Envar            Envar            `json:"variables"`
	Port             Port             `json:"ports"`
	Scale            Scale            `json:"scale"`
	Affinity         Affinity         `json:"affinity"`
	DeploymentConfig DeploymentConfig `json:"deployment_config"`
	CreatedBy        int              `json_name:"created_by"`
}

func (*Deployment) GetK8sLabel

func (d *Deployment) GetK8sLabel(additionalLabel ...DeploymentLabel) map[string]string

func (*Deployment) IsDifferentDeploymentConfig

func (d1 *Deployment) IsDifferentDeploymentConfig(d2 Deployment) bool

type DeploymentConfig

type DeploymentConfig struct {
	Id             int           `json:"id"`
	Project        string        `json:"project"`
	Env            string        `json:"env"`
	Name           string        `json:"name"`
	LivenessProbe  *HttpGetProbe `json:"liveness_probe"`
	ReadinessProbe *HttpGetProbe `json:"readiness_probe"`
	StartupProbe   *HttpGetProbe `json:"startup_probe"`
	CreatedBy      int           `json:"created_by"`
}

type DeploymentLabel

type DeploymentLabel struct {
	Key   string
	Value string
}

type Envar

type Envar struct {
	Project   string                 `json:"project"`
	Env       string                 `json:"env"`
	Name      string                 `json:"name"`
	Variables map[string]interface{} `json:"variables"`
	CreatedBy int                    `json:"created_by"`
}

func (Envar) DefaultEnvar

func (Envar) DefaultEnvar(env, name string) *Envar

type HttpGetProbe

type HttpGetProbe struct {
	Path                string `json:"path"`
	Port                int    `json:"port"`
	FailureThreshold    int    `json:"failure_threshold"`
	PeriodSeconds       int    `json:"period_seconds"`
	InitialDelaySeconds int    `json:"initial_delay_seconds"`
}

type Image

type Image struct {
	Id          int        `json:"id"`
	Digest      string     `json:"digest"`
	Image       string     `json:"image"`
	Project     string     `json:"project"`
	Repository  string     `json:"repository"`
	Description string     `json:"description"`
	CreatedBy   int        `json:"created_by"`
	CreatedAt   *time.Time `json:"created_at"`
	Notes       string     `json:"notes"` // This is for environment last deployment
}

type Migration

type Migration struct {
	Id        int        `json_name:"id"`
	Name      string     `json_name:"name"`
	CreatedAt *time.Time `json_name:"created_at"`
	UpdatedAt *time.Time `json_name:"updated_at"`
}

type Port

type Port struct {
	Project    string     `json:"project"`
	Env        string     `json:"env"`
	Name       string     `json:"name"`
	AccessType AccessType `json:"access_type"`
	ExternalIP string     `json:"external_ip"`
	Ports      []PortSpec `json:"ports"`
	CreatedBy  int        `json:"created_by"`
}

func (Port) DefaultPort

func (Port) DefaultPort(env, name string) *Port

type PortProtocolType

type PortProtocolType string
const (
	Port_TCP  PortProtocolType = "TCP"
	Port_UDP  PortProtocolType = "UDP"
	Port_SCTP PortProtocolType = "SCTP"
)

type PortSpec

type PortSpec struct {
	Name       string           `json:"name"`
	Port       int              `json:"port"`
	RemotePort int              `json:"remote_port"`
	Protocol   PortProtocolType `json:"protocol"`
}

type PortTemplate

type PortTemplate struct {
	TemplateName string     `json:"-"`
	AccessType   AccessType `json:"access_type"`
	ExternalIP   string     `json:"external_ip"`
	Ports        []PortSpec `json:"ports"`
}

func (PortTemplate) DefaultPortTemplate

func (PortTemplate) DefaultPortTemplate() *PortTemplate

func (*PortTemplate) ToPortEntity

func (pt *PortTemplate) ToPortEntity(env, name string) *Port

type Project

type Project struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func (*Project) ValidateName

func (p *Project) ValidateName() error

type Scale

type Scale struct {
	Project              string `json:"project"`
	Env                  string `json:"env"`
	Name                 string `json:"name"`
	MinReplica           int    `json_name:"min_replica"`
	MaxReplica           int    `json_name:"max_replica"`
	MinCpu               int    `json_name:"min_cpu"`
	MaxCpu               int    `json_name:"max_cpu"`
	MinMemory            int    `json_name:"min_memory"`
	MaxMemory            int    `json_name:"max_memory"`
	TargetCPUUtilization int    `json_name:"target_cpu"`
	CreatedBy            int    `json:"created_by"`
}

func (Scale) DefaultScale

func (Scale) DefaultScale(project, env, name string) *Scale

type User

type User struct {
	Id       int      `json:"id"`
	Email    string   `json:"email"`
	Password string   `json:"password"`
	UserType UserType `json:"usertype"`
	Name     string   `json:"name"`
	Token    string   `json:"token"`
}

type UserType

type UserType string
const (
	UserType_Admin UserType = "admin"
	UserType_User  UserType = "user"
)

Jump to

Keyboard shortcuts

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