index

package
v0.33.10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectRepo added in v0.32.0

type CollectRepo interface {
	// GetIndexCollect get and index colelct item if exists
	GetIndexCollect(ctx context.Context, id model.IndexID, uid model.UserID) (*IndexCollect, error)

	// AddIndexCollect add an index collect to given user
	AddIndexCollect(ctx context.Context, id model.IndexID, uid model.UserID) error

	// DeleteIndexCollect remove index collect from given user
	DeleteIndexCollect(ctx context.Context, id model.IndexID, uid model.UserID) error
}

type IndexCollect added in v0.32.0

type IndexCollect struct {
	ID          uint32
	IndexID     model.IndexID
	UserID      model.UserID
	CreatedTime time.Time
}

type IndexRepo added in v0.32.0

type IndexRepo interface {
	Get(ctx context.Context, id model.IndexID) (model.Index, error)
	New(ctx context.Context, i *model.Index) error
	Update(ctx context.Context, id model.IndexID, title string, desc string) error
	Delete(ctx context.Context, id model.IndexID) error
}

type Repo added in v0.30.3

type Repo interface {
	IndexRepo
	SubjectRepo
	CollectRepo
}

func NewMysqlRepo

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

type Subject added in v0.30.3

type Subject struct {
	Comment string
	AddedAt time.Time
	Subject model.Subject
}

type SubjectRepo added in v0.32.0

type SubjectRepo interface {
	CountSubjects(ctx context.Context, id model.IndexID, subjectType model.SubjectType) (int64, error)
	ListSubjects(
		ctx context.Context, id model.IndexID, subjectType model.SubjectType, limit, offset int,
	) ([]Subject, error)
	AddOrUpdateIndexSubject(
		ctx context.Context, id model.IndexID, subjectID model.SubjectID, sort uint32, comment string,
	) (*Subject, error)
	DeleteIndexSubject(
		ctx context.Context, id model.IndexID, subjectID model.SubjectID,
	) error
}

Jump to

Keyboard shortcuts

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