handler

package
v0.0.0-...-774d41c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 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       primitive.ObjectID `json:"id"`
	Fact     string             `json:"fact"`
	Source   string             `json:"source"`
	Approved bool               `json:"approved"`
}

type FactsHandler

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

func NewFactsHandler

func NewFactsHandler(factsRepository repository.FactsRepository) *FactsHandler

func (*FactsHandler) Approve

func (f *FactsHandler) Approve(factID primitive.ObjectID) error

func (*FactsHandler) Create

func (f *FactsHandler) Create(fact *Fact) error

func (*FactsHandler) Delete

func (f *FactsHandler) Delete(id primitive.ObjectID) error

func (*FactsHandler) GetAll

func (f *FactsHandler) GetAll() ([]*repository.Fact, error)

func (*FactsHandler) Unapprove

func (f *FactsHandler) Unapprove(factID primitive.ObjectID) error

func (*FactsHandler) Update

func (f *FactsHandler) Update(fact *Fact) error

Jump to

Keyboard shortcuts

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