dao

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodebookCollection = "c_codebook"
)

Variables

View Source
var ErrDataNotFound = mongo.ErrNoDocuments

ErrDataNotFound 通用的数据没找到

Functions

This section is empty.

Types

type Codebook

type Codebook struct {
	Id         int64  `bson:"id"`
	Name       string `bson:"name"`
	Owner      string `bson:"owner"`
	Identifier string `bson:"identifier"` // 唯一标识
	Code       string `bson:"code"`
	Language   string `bson:"language"`
	Secret     string `bson:"secret"` // 密钥信息
	Ctime      int64  `bson:"ctime"`
	Utime      int64  `bson:"utime"`
}

type CodebookDAO

type CodebookDAO interface {
	CreateCodebook(ctx context.Context, c Codebook) (int64, error)
	DetailCodebook(ctx context.Context, id int64) (Codebook, error)
	ListCodebook(ctx context.Context, offset, limit int64) ([]Codebook, error)
	Count(ctx context.Context) (int64, error)
	UpdateCodebook(ctx context.Context, c Codebook) (int64, error)
	DeleteCodebook(ctx context.Context, id int64) (int64, error)
	FindBySecret(ctx context.Context, identifier string, secret string) (Codebook, error)
	FindByUid(ctx context.Context, identifier string) (Codebook, error)
	FindByUids(ctx context.Context, uids []string) ([]Codebook, error)
}

func NewCodebookDAO

func NewCodebookDAO(db *mongox.Mongo) CodebookDAO

Jump to

Keyboard shortcuts

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