books

package
v0.152.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func Register

func Register(router *mvc.Router, repo Repository) error

Register books.

Types

type Book

type Book struct {
	Title string `yaml:"title,omitempty"`
	Link  string `yaml:"link,omitempty"`
}

Book for books.

type FSRepository added in v0.140.0

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

FSRepository has books in a file.

func (*FSRepository) GetBooks added in v0.140.0

func (r *FSRepository) GetBooks() *Model

GetBooks from a file.

type Model

type Model struct {
	Books []*Book `yaml:"books,omitempty"`
}

Model for books.

type Repository added in v0.125.0

type Repository interface {
	// GetBooks from storage.
	GetBooks() *Model
}

Repository for books.

func NewRepository added in v0.125.0

func NewRepository(filesystem fs.FS, enc *yaml.Encoder) Repository

NewRepository for books.

Jump to

Keyboard shortcuts

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