dao

package
v0.0.0-...-969384c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 {
	// Get the specified label
	Get(ctx context.Context, id int64) (label *model.Label, err error)
	// Create the label
	Create(ctx context.Context, label *model.Label) (id int64, err error)
	// Count returns the total count of Labels according to the query
	Count(ctx context.Context, query *q.Query) (total int64, err error)
	// Update the label
	Update(ctx context.Context, label *model.Label) error
	// Delete the label
	Delete(ctx context.Context, id int64) (err error)
	// List ...
	List(ctx context.Context, query *q.Query) ([]*model.Label, error)

	// List labels that added to the artifact specified by the ID
	ListByArtifact(ctx context.Context, artifactID int64) (labels []*model.Label, err error)
	// Create label reference
	CreateReference(ctx context.Context, reference *model.Reference) (id int64, err error)
	// Delete the label reference specified by ID
	DeleteReference(ctx context.Context, id int64) (err error)
	// Delete label references specified by query
	DeleteReferences(ctx context.Context, query *q.Query) (n int64, err error)
}

DAO is the data access object interface for label

func New

func New() DAO

New creates an instance of the default DAO

Jump to

Keyboard shortcuts

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