mongo

package
v0.4.15 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

Mongo contains functions for manga mongodb.

func New

func New(db *mongo.Database, finishedAge, releasingAge, notYetAge int) *Mongo

New to create new manga database.

func (*Mongo) DeleteByID

func (m *Mongo) DeleteByID(ctx context.Context, id int64) (int, error)

DeleteByID to delete manga by id.

func (*Mongo) GetAll added in v0.2.0

func (m *Mongo) GetAll(ctx context.Context, data entity.GetAllRequest) ([]entity.Manga, int, int, error)

GetAll to get all data.

func (*Mongo) GetByID

func (m *Mongo) GetByID(ctx context.Context, id int64) (*entity.Manga, int, error)

GetByID to get manga by id.

func (*Mongo) GetIDs

func (m *Mongo) GetIDs(ctx context.Context) ([]int64, int, error)

GetIDs to get ids.

func (*Mongo) GetMaxID

func (m *Mongo) GetMaxID(ctx context.Context) (int64, int, error)

GetMaxID to get max id.

func (*Mongo) GetOldFinishedIDs

func (m *Mongo) GetOldFinishedIDs(ctx context.Context) ([]int64, int, error)

GetOldFinishedIDs to get old finished manga id.

func (*Mongo) GetOldNotYetIDs

func (m *Mongo) GetOldNotYetIDs(ctx context.Context) ([]int64, int, error)

GetOldNotYetIDs to get not yet released manga id.

func (*Mongo) GetOldReleasingIDs

func (m *Mongo) GetOldReleasingIDs(ctx context.Context) ([]int64, int, error)

GetOldReleasingIDs to get old releasing manga id.

func (*Mongo) IsOld

func (m *Mongo) IsOld(ctx context.Context, id int64) (bool, int, error)

IsOld to check if old.

func (*Mongo) Update

func (m *Mongo) Update(ctx context.Context, data entity.Manga) (int, error)

Update to update manga.

Jump to

Keyboard shortcuts

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