service

package
v0.0.0-...-d3fe3c7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoxFromRequest

func GetBoxFromRequest(body string) model.Box

func GetThingFromRequest

func GetThingFromRequest(body string) model.Thing

Types

type BoxContent

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

func NewBoxContent

func NewBoxContent(db Storage, boxID string) BoxContent

func (BoxContent) Run

func (b BoxContent) Run() (interface{}, error)

type BoxContentResult

type BoxContentResult struct {
	Boxes  []model.Box   `json:"box"`
	Things []model.Thing `json:"thing"`
}

func (BoxContentResult) Equals

func (b BoxContentResult) Equals(that BoxContentResult) bool

type GetTopBoxes

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

func NewGetTopBoxesService

func NewGetTopBoxesService(db Storage, userName string) GetTopBoxes

func (GetTopBoxes) Run

func (b GetTopBoxes) Run() (interface{}, error)

type SaveBox

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

func NewSaveBox

func NewSaveBox(db Storage, b model.Box) SaveBox

func (SaveBox) Run

func (s SaveBox) Run() (interface{}, error)

type SaveThing

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

func NewSaveThing

func NewSaveThing(db Storage, t model.Thing, boxID string) SaveThing

func (SaveThing) Run

func (s SaveThing) Run() (interface{}, error)

type SaveTopBox

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

func NewSaveTopBox

func NewSaveTopBox(db Storage, userName string, b model.Box) SaveTopBox

func (SaveTopBox) Run

func (s SaveTopBox) Run() (interface{}, error)

type Storage

type Storage interface {
	GetTopLevelBoxesForUser(userID string) ([]model.Box, error)
	SaveBox(b model.Box) error
	SaveThing(t model.Thing, boxID string) error
	GetBoxContent(boxID string) (BoxContentResult, error)
	SaveTopBox(userName string, b model.Box) error
}

Jump to

Keyboard shortcuts

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