dao

package
v0.0.0-...-66c98c8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 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 Accessory

type Accessory struct {
	ID                    int64     `orm:"pk;auto;column(id)" json:"id"`
	ArtifactID            int64     `orm:"column(artifact_id)" json:"artifact_id"`
	SubjectArtifactID     int64     `orm:"column(subject_artifact_id)" json:"subject_artifact_id"`
	SubjectArtifactRepo   string    `orm:"column(subject_artifact_repo)" json:"subject_artifact_repo"`
	SubjectArtifactDigest string    `orm:"column(subject_artifact_digest)" json:"subject_artifact_digest"`
	Type                  string    `orm:"column(type)" json:"type"`
	Size                  int64     `orm:"column(size)" json:"size"`
	Digest                string    `orm:"column(digest)" json:"digest"`
	CreationTime          time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
}

Accessory model in database

func (*Accessory) TableName

func (a *Accessory) TableName() string

TableName for artifact reference

type DAO

type DAO interface {
	// Count returns the total count of accessory according to the query
	Count(ctx context.Context, query *q.Query) (total int64, err error)
	// List accessory according to the query
	List(ctx context.Context, query *q.Query) (accs []*Accessory, err error)
	// Get the accessory specified by ID
	Get(ctx context.Context, id int64) (accessory *Accessory, err error)
	// Create the accessory
	Create(ctx context.Context, accessory *Accessory) (id int64, err error)
	// Update the accessory
	Update(ctx context.Context, accessory *Accessory) error
	// Delete the accessory specified by ID
	Delete(ctx context.Context, id int64) (err error)
	// DeleteAccessories deletes accessories by query
	DeleteAccessories(ctx context.Context, query *q.Query) (int64, error)
}

DAO is the data access object for accessory

func New

func New() DAO

New returns an instance of the default DAO

Jump to

Keyboard shortcuts

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