db

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*gorm.DB
}

func (*Client) CreateExtension

func (client *Client) CreateExtension(extension *Extension) error

func (*Client) CreateExtensionVersion

func (client *Client) CreateExtensionVersion(version *ExtensionVersion) error

func (*Client) DeleteExtension

func (client *Client) DeleteExtension(name string) error

func (*Client) DeleteExtensionVersion

func (client *Client) DeleteExtensionVersion(name, version string) error

func (*Client) GetExtension

func (client *Client) GetExtension(name string) (*Extension, error)

func (*Client) GetExtensionDefaultVersion

func (client *Client) GetExtensionDefaultVersion(name string) (*ExtensionVersion, error)

func (*Client) GetExtensionVersion

func (client *Client) GetExtensionVersion(name string, version string) (*ExtensionVersion, error)

func (*Client) GetExtensionVersionCount

func (client *Client) GetExtensionVersionCount(name string) (int64, error)

func (*Client) IsExtensionPublicVersionExist

func (client *Client) IsExtensionPublicVersionExist(name string) (bool, error)

func (*Client) ListExtensionVersions

func (client *Client) ListExtensionVersions(names []string, all bool) (map[string][]ExtensionVersion, error)

func (*Client) QueryAllExtensions

func (client *Client) QueryAllExtensions() ([]ExtensionVersion, error)

func (*Client) QueryExtensionVersions

func (client *Client) QueryExtensionVersions(name string, all bool, orderByVersionDesc bool) ([]ExtensionVersion, error)

func (*Client) QueryExtensions

func (client *Client) QueryExtensions(all bool, typ string, labels string) ([]Extension, error)

func (*Client) SetUnDefaultVersion

func (client *Client) SetUnDefaultVersion(name string) error

type Extension

type Extension struct {
	dbengine.BaseModel
	Type        string `json:"type" gorm:"type:varchar(128)"` // type addon|action
	Name        string `json:"name" grom:"type:varchar(128);unique_index"`
	Category    string `json:"category" grom:"type:varchar(128)"`
	DisplayName string `json:"displayName" grom:"type:varchar(128)"`
	LogoUrl     string `json:"logoUrl" grom:"type:varchar(128)"`
	Desc        string `json:"desc" grom:"type:text"`
	Labels      string `json:"labels" grom:"type:labels"`
	Public      bool   `json:"public" ` // Whether to display in the service market
}

func (Extension) TableName

func (Extension) TableName() string

func (*Extension) ToApiData

func (ext *Extension) ToApiData() *pb.Extension

type ExtensionVersion

type ExtensionVersion struct {
	dbengine.BaseModel
	ExtensionId uint64 `json:"extensionId"`
	Name        string `gorm:"type:varchar(128);index:idx_name"`
	Version     string `json:"version" gorm:"type:varchar(128);index:idx_version"`
	Spec        string `gorm:"type:text"`
	Dice        string `gorm:"type:text"`
	Swagger     string `gorm:"type:longtext"`
	Readme      string `gorm:"type:longtext"`
	Public      bool   `json:"public"`
	IsDefault   bool   `json:"is_default"`
}

func (*ExtensionVersion) SpecI18nReplace

func (ext *ExtensionVersion) SpecI18nReplace() (withLocaleInfo bool, spec interface{})

func (ExtensionVersion) TableName

func (ExtensionVersion) TableName() string

func (*ExtensionVersion) ToApiData

func (ext *ExtensionVersion) ToApiData(typ string, yamlFormat bool) (*pb.ExtensionVersion, error)

Jump to

Keyboard shortcuts

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