repositoryimpl

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloudRepo

func NewCloudRepo(m mongodbClient) repository.Cloud

func NewPodRepo

func NewPodRepo(cfg *Config) repository.Pod

Types

type Config

type Config struct {
	Table Table `json:"table" required:"true"`
}

type DCloudConf

type DCloudConf struct {
	Id            string    `bson:"id"                json:"id"`
	Name          string    `bson:"name"              json:"name"`
	Specs         []SpecDO  `bson:"specs"             json:"specs"`
	Images        []ImageDO `bson:"images"            json:"images"`
	Feature       string    `bson:"feature"           json:"feature"`
	Processor     string    `bson:"processor"         json:"processor"`
	SingleLimited int       `bson:"single_limited"    json:"single_limited"`
	MultiLimited  int       `bson:"multi_limited"     json:"multi_limited"`
	Credit        int64     `bson:"credit"            json:"credit"`
}

type ImageDO added in v1.1.1

type ImageDO struct {
	Alias string `bson:"alias" json:"alias"`
	Image string `bson:"image" json:"image"`
}

type SpecDO added in v1.3.0

type SpecDO struct {
	Desc     string `bson:"desc" json:"desc"`
	CardsNum int    `bson:"cards_num" json:"cards_num"`
}

type TPod

type TPod struct {
	Id        string `gorm:"type:uuid;default:gen_random_uuid();primaryKey"`
	CloudId   string `gorm:"column:cloud_id;not null"`
	Owner     string `gorm:"column:owner;not null"`
	Status    string `gorm:"column:status;not null"`
	Expiry    int64  `gorm:"column:expiry;not null"`
	Error     string `gorm:"column:error"`
	AccessURL string `gorm:"column:access_url"`
	CreatedAt int64  `gorm:"column:created_at;not null;default:extract(epoch from now())"`
	CardsNum  int    `gorm:"column:cards_num;not null"`
	Image     string `gorm:"column:image;not null"`
}

func (TPod) TableName

func (TPod) TableName() string

type Table

type Table struct {
	Pod string `json:"pod" required:"true"`
}

Jump to

Keyboard shortcuts

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