categories

package
v0.0.0-...-9f86afd Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const QueryGetAll = `` /* 126-byte string literal not displayed */
View Source
const QueryGetDetail = `
SELECT name, title, description 
FROM categories 
WHERE id=$1;`
View Source
const QueryInsert = `
INSERT INTO 
	categories(name, title, description) 
	VALUES($1, $2, $3) 
RETURNING id;`

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CursorSecret string `koanf:"cursor_secret"`
	Limit        struct {
		Min int `koanf:"min"`
		Max int `koanf:"max"`
	} `koanf:"limit"`
}

func (Config) Default

func (c Config) Default() *Config

type Repository

type Repository interface {
	MigrateUp(context.Context) error
	MigrateDown(context.Context) error

	// insert a category
	Insert(context.Context, *models.Category) error

	// get category detail
	GetById(ctx context.Context, id uint64) (*models.Category, error)

	// search + pagination (no detail)
	GetAll(ctx context.Context, encryptedCursor, search string, limit int) ([]models.Category, string, error)
}

Jump to

Keyboard shortcuts

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