dao

package
v0.0.0-...-a14a4d2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO interface {
	// Create the registry
	Create(ctx context.Context, registry *Registry) (id int64, err error)
	// Count returns the count of registries according to the query
	Count(ctx context.Context, query *q.Query) (count int64, err error)
	// List the registries according to the query
	List(ctx context.Context, query *q.Query) (registries []*Registry, err error)
	// Get the registry specified by ID
	Get(ctx context.Context, id int64) (registry *Registry, err error)
	// Update the specified registry
	Update(ctx context.Context, registry *Registry, props ...string) (err error)
	// Delete the registry specified by ID
	Delete(ctx context.Context, id int64) (err error)
}

DAO defines the DAO operations of registry

func NewDAO

func NewDAO() DAO

NewDAO creates an instance of DAO

type Registry

type Registry struct {
	ID             int64     `orm:"pk;auto;column(id)"`
	URL            string    `orm:"column(url)"`
	Name           string    `orm:"column(name)"`
	CredentialType string    `orm:"column(credential_type);default(basic)"`
	AccessKey      string    `orm:"column(access_key)"`
	AccessSecret   string    `orm:"column(access_secret)"`
	Type           string    `orm:"column(type)"`
	Insecure       bool      `orm:"column(insecure)"`
	Description    string    `orm:"column(description)"`
	Status         string    `orm:"column(health)"`
	CreationTime   time.Time `orm:"column(creation_time);auto_now_add"`
	UpdateTime     time.Time `orm:"column(update_time);auto_now"`
}

Registry is the model for a registry, which wraps the endpoint URL and credential of a remote registry.

func (*Registry) TableName

func (r *Registry) TableName() string

TableName is required by by beego orm to map Registry to table registry

Jump to

Keyboard shortcuts

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