categorizersrps

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CategorizersCollection = "categories"

Variables

This section is empty.

Functions

This section is empty.

Types

type CRepository

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

CRepository provides a mongo collection for categorizer job.

func (*CRepository) DeleteAll

func (r *CRepository) DeleteAll() error

DeleteAll drops categorizers collection.

func (*CRepository) GetById

func (r *CRepository) GetById(id string) (url *categorizersmdl.Categorizer, err error)

GetById returns the url based on id.

func (*CRepository) Save

Save adds url to database.

func (*CRepository) Update

func (r *CRepository) Update(category *categorizersmdl.Categorizer) error

Update updates the category.

type CategorizersRepository

type CategorizersRepository interface {
	Save(url *categorizersmdl.Categorizer) error
	GetById(id string) (url *categorizersmdl.Categorizer, err error)
	Update(category *categorizersmdl.Categorizer) error
}

CategorizersRepository is the interface of the categorizer backend.

func NewCategorizersRepository

func NewCategorizersRepository(conn db.Connection) CategorizersRepository

NewCategorizersRepository creates a new CategorizersRepository instance.

Jump to

Keyboard shortcuts

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