model

package
v0.0.0-...-e907df4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMetadataMap

func ToMetadataMap(ms []*Metadata, name string) (map[string]string, bool)

Types

type App

type App struct {
	ID            int64     `db:"id" json:"id"`
	Name          string    `db:"name" json:"name"`
	Display       *string   `db:"display" json:"display"`
	Description   *string   `db:"description" json:"description"`
	DockerCompose *string   `db:"docker_compose" json:"docker_compose"`
	Version       string    `db:"version" json:"version"`
	Icon          string    `db:"icon" json:"icon"`
	CreatedAt     time.Time `db:"created_at" json:"created_at"`
	UpdatedAt     time.Time `db:"updated_at" json:"updated_at"`
	QA            *string   `db:"qa" json:"qa"`
	Metadata      *string   `db:"metadata" json:"metadata"`
	// installer file some like xxx.tar.gz
	StaticPath *string `db:"static_path" json:"static_path"`
}

func (*App) GetDefaultEnv

func (a *App) GetDefaultEnv() map[string]string

func (*App) ToView

func (a *App) ToView() *AppView

type AppQAItem

type AppQAItem struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	DefaultValue string   `json:"default_value"`
	Options      []string `json:"options"`
	Required     bool     `json:"required"`
	Description  string   `json:"description"`
}

type AppView

type AppView struct {
	ID            int64        `json:"id"`
	Name          string       `json:"name"`
	Display       *string      `json:"display"`
	Description   *string      `json:"description"`
	DockerCompose *string      `json:"docker_compose"`
	Version       string       `json:"version"`
	Icon          string       `json:"icon"`
	QA            []*AppQAItem `json:"qa"`
	Metadata      []*Metadata  `json:"metadata"`
	StaticPath    *string      `json:"static_path"`
}

func (*AppView) ToModel

func (a *AppView) ToModel() *App

type DockerEvent

type DockerEvent struct {
	NodeId int64          `json:"node_id"`
	Event  events.Message `json:"event"`
}

type Env

type Env struct {
	ID          int64     `db:"id" json:"id"`
	Key         string    `db:"key" json:"key"`
	Value       string    `db:"value" json:"value"`
	Scope       string    `db:"scope" json:"scope"`
	Description string    `db:"description" json:"description"`
	Metadata    string    `db:"metadata" json:"metadata"`
	CreatedAt   time.Time `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time `db:"updated_at" json:"updated_at"`
}

type Metadata

type Metadata struct {
	MetadataBase `json:",inline"`
}

func (*Metadata) ToMap

func (m *Metadata) ToMap() map[string]string

type MetadataBase

type MetadataBase struct {
	Name       string            `json:"name,omitempty"`
	Properties map[string]string `json:"properties,omitempty"`
}

type Node

type Node struct {
	ID          int64     `db:"id" json:"id"`
	IsLocal     bool      `db:"is_local" json:"is_local"`
	Name        string    `db:"name" json:"name"`
	DisplayName *string   `db:"display_name" json:"display_name"`
	Address     string    `db:"address" json:"address"`
	SSHPort     int       `db:"ssh_port" json:"ssh_port"`
	AgentPort   int       `db:"agent_port" json:"agent_port"`
	SSHUser     string    `db:"ssh_user" json:"ssh_user"`
	SSHPassword string    `db:"ssh_password" json:"ssh_password"`
	Status      string    `db:"status" json:"status"`
	CreatedAt   time.Time `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time `db:"updated_at" json:"updated_at"`
	Metadata    *string   `db:"metadata" json:"metadata"`
	DataPath    *string   `db:"data_path" json:"data_path"`
}

func (*Node) GetDecryptedSSHPassword

func (n *Node) GetDecryptedSSHPassword() (string, error)

func (*Node) ToView

func (n *Node) ToView() *NodeView

type NodeView

type NodeView struct {
	ID                 int64   `json:"id"`
	IsLocal            bool    `json:"is_local"`
	Name               string  `json:"name"`
	DisplayName        *string `json:"display_name"`
	Address            string  `json:"address"`
	Status             string  `json:"status"`
	SSHUser            string  `json:"ssh_user"`
	RequestSSHPassword *string `json:"ssh_password"`
	SSHPort            int     `json:"ssh_port"`
	AgentPort          int     `json:"agent_port"`
}

func (*NodeView) ToModel

func (v *NodeView) ToModel() (*Node, error)

type RegistryRequest

type RegistryRequest struct {
	Name      string  `json:"name"`
	Address   string  `json:"address"`
	AgentPort int     `json:"agent_port"`
	IsLocal   bool    `json:"is_local"`
	Status    string  `json:"status"`
	DataPath  *string `json:"data_path,omitempty"`
}

type RegistryResponse

type RegistryResponse struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type Service

type Service struct {
	ID         int64     `db:"id" json:"id"`
	Name       string    `db:"name" json:"name"`
	AppID      int64     `db:"app_id" json:"app_id"`
	NodeID     int64     `db:"node_id" json:"node_id"`
	Status     string    `db:"status" json:"status"`
	CreatedAt  time.Time `db:"created_at" json:"created_at"`
	UpdatedAt  time.Time `db:"updated_at" json:"updated_at"`
	Metadata   *string   `db:"metadata" json:"metadata"`
	DeployInfo *string   `db:"deploy_info" json:"deploy_info"`

	AppName  string `db:"app_name" json:"app_name"`
	NodeName string `db:"node_name" json:"node_name"`
}

func (*Service) ToView

func (s *Service) ToView() *ServiceView

type ServiceView

type ServiceView struct {
	ID       int64             `json:"id"`
	Name     string            `json:"name"`
	AppID    int64             `json:"app_id"`
	NodeID   int64             `json:"node_id"`
	Status   string            `json:"status,omitempty"`
	QAValues map[string]string `json:"qa_values"`
	AppName  string            `json:"app_name"`
	NodeName string            `json:"node_name"`
}

func (*ServiceView) ToModel

func (v *ServiceView) ToModel() *Service

type User

type User struct {
	ID        int64     `db:"id"`
	Username  string    `db:"username"`
	Email     string    `db:"email"`
	Role      string    `db:"role"`
	Name      string    `db:"name"`
	Password  string    `db:"password"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Jump to

Keyboard shortcuts

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