episode

package
v0.33.19 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Episode added in v0.30.3

type Episode struct {
	Airdate     string
	Name        string
	NameCN      string
	Duration    string
	Description string
	Ep          float32
	SubjectID   model.SubjectID
	Sort        float32
	Comment     uint32
	ID          model.EpisodeID
	Type        Type
	Disc        uint8
}

func (Episode) GetID added in v0.30.3

func (e Episode) GetID() model.EpisodeID

func (Episode) Less added in v0.30.3

func (e Episode) Less(o Episode) bool

type Filter added in v0.30.3

type Filter struct {
	Type null.Null[Type]
}

type Repo added in v0.30.3

type Repo interface {
	// WithQuery is used to replace repo's query to txn
	WithQuery(query *query.Query) Repo

	Get(ctx context.Context, episodeID model.EpisodeID) (Episode, error)

	// Count all episode for a subject.
	Count(ctx context.Context, subjectID model.SubjectID, filter Filter) (int64, error)

	// List return all episode.
	List(
		ctx context.Context,
		subjectID model.SubjectID,
		filter Filter,
		limit int, offset int,
	) ([]Episode, error)
}

func NewMysqlRepo

func NewMysqlRepo(q *query.Query, log *zap.Logger) (Repo, error)

type Type added in v0.30.3

type Type = uint8
const (
	TypeNormal  Type = 0
	TypeSpecial Type = 1
	TypeOpening Type = 2
	TypeEnding  Type = 3
	TypeMad     Type = 4
	TypeOther   Type = 6
)

Jump to

Keyboard shortcuts

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