handler

package
v0.0.0-...-a093bcc Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("fact not found")
)

Functions

This section is empty.

Types

type Fact

type Fact struct {
	ID     string `json:"id"`
	Fact   string `json:"fact"`
	Source string `json:"source"`
}

type FactsHandler

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

func NewFactsHandler

func NewFactsHandler(factsRepository repository.FactsRepository) *FactsHandler

func (*FactsHandler) Get

func (f *FactsHandler) Get(id primitive.ObjectID) (*Fact, error)

func (*FactsHandler) GetFactsCount

func (f *FactsHandler) GetFactsCount() (int, error)

func (*FactsHandler) GetRandomApproved

func (f *FactsHandler) GetRandomApproved() (*Fact, error)

Jump to

Keyboard shortcuts

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