core

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Author      string `json:"author"`
	Summary     string `json:"summary"`
	Description string `json:"description"`
	ImageLink   string `json:"image_link"`
	Category    string `json:"category"`
	Featured    bool   `json:"featured"`
}

type QueryArgs

type QueryArgs struct {
	SearchTerm string
	Offset     *int
	Limit      *int
}

type Repository

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

func NewRepository

func NewRepository(db *ent.Client) *Repository

func (*Repository) DeleteByID

func (r *Repository) DeleteByID(ctx context.Context, id string) error

func (*Repository) FindByID

func (r *Repository) FindByID(ctx context.Context, id string) (*Book, error)

func (*Repository) FindFeaturedBooks

func (r *Repository) FindFeaturedBooks(ctx context.Context) []Book

func (*Repository) GetAll

func (r *Repository) GetAll(ctx context.Context, args QueryArgs) []Book

func (*Repository) GetTotalCount

func (r *Repository) GetTotalCount(ctx context.Context) (int, error)

func (*Repository) InsertNew

func (r *Repository) InsertNew(ctx context.Context, in *Book) (*Book, error)

func (*Repository) Query

func (r *Repository) Query(ctx context.Context, args QueryArgs) []Book

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, in *Book) (*Book, error)

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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