model

package
v0.0.0-...-a7ced60 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	gorm.Model
	ID         uuid.UUID `json:"id" gorm:"primaryKey"`
	Username   string
	OrgID      string
	Status     string
	StatusInfo string
	CredUrl    string
	Version    string
	SourceID   uuid.UUID
}

func NewAgentForSource

func NewAgentForSource(id uuid.UUID, source Source) Agent

func (Agent) String

func (a Agent) String() string

type AgentList

type AgentList []Agent

type ImageInfra

type ImageInfra struct {
	gorm.Model
	SourceID         uuid.UUID `gorm:"primaryKey"`
	HttpProxyUrl     string
	HttpsProxyUrl    string
	NoProxyDomains   string
	CertificateChain string
	SshPublicKey     string
	ImageTokenKey    string
}

type JSONField

type JSONField[T any] struct {
	Data T
}

JSONField wraps an arbitrary struct so that it can be included in a GORM model, for use in a JSON/JSONB field

func MakeJSONField

func MakeJSONField[T any](data T) *JSONField[T]

Return a copy of 'data', wrapped in a JSONField object

func (JSONField[T]) MarshalJSON

func (j JSONField[T]) MarshalJSON() ([]byte, error)

func (*JSONField[T]) Scan

func (j *JSONField[T]) Scan(src any) error

func (*JSONField[T]) UnmarshalJSON

func (j *JSONField[T]) UnmarshalJSON(b []byte) error

func (JSONField[T]) Value

func (j JSONField[T]) Value() (driver.Value, error)

type Source

type Source struct {
	gorm.Model
	ID         uuid.UUID `gorm:"primaryKey; not null"`
	Name       string    `gorm:"uniqueIndex:name_org_id;not null"`
	VCenterID  string
	Username   string
	OrgID      string                    `gorm:"uniqueIndex:name_org_id;not null"`
	Inventory  *JSONField[api.Inventory] `gorm:"type:jsonb"`
	OnPremises bool
	Agents     []Agent    `gorm:"constraint:OnDelete:CASCADE;"`
	ImageInfra ImageInfra `gorm:"constraint:OnDelete:CASCADE;"`
}

func (Source) String

func (s Source) String() string

type SourceList

type SourceList []Source

Jump to

Keyboard shortcuts

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