serviceapi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: GPL-2.0 Imports: 10 Imported by: 0

README

The main API which is used by different (G)UI(s) such as:

Uses Storage to store different objects

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service interacts with backend storage to save and fetch data transparently

func New

func New(storage storageimpl.Storage, defaultLanguage language.Tag) (svc *Service)

New returns *Service which uses given backend storage Note: Service handles all possible caching

func (Service) EntryGet

func (r Service) EntryGet(ctx context.Context, fromtime time.Time, precision time.Duration) (items []*serviceitems.Entry, internalError error)

func (Service) EntryLevelUpdate

func (r Service) EntryLevelUpdate(ctx context.Context, update serviceitems.EntryLevelUpdate) (userError []UserError, internalError error)

func (Service) EntryLevelsList

func (r Service) EntryLevelsList(ctx context.Context) (levelList []*serviceitems.EntryLevel, internalError error)

func (Service) EntryUpdate

func (r Service) EntryUpdate(ctx context.Context, item serviceitems.EntryUpdate) (userError []UserError, internalError error)

func (Service) HeightList

func (r Service) HeightList(ctx context.Context) (l []*serviceitems.Height, internalError error)

func (Service) HeightUpdate

func (r Service) HeightUpdate(ctx context.Context, add serviceitems.HeightAdd) (userError []UserError, internalError error)

func (Service) ReOccurringTaskList

func (r Service) ReOccurringTaskList(ctx context.Context) (list []*serviceitems.ReoccurringTask, internalError error)

func (Service) ReOccurringTaskUpdate

func (r Service) ReOccurringTaskUpdate(ctx context.Context, update serviceitems.ReoccurringTaskUpdate) (newid int, userErrors []UserError, internalError error)

func (Service) TagGet

func (r Service) TagGet(ctx context.Context, i int) (*serviceitems.Tag, error)

func (Service) TagList

func (r Service) TagList(ctx context.Context) (tags []*serviceitems.Tag, err error)

func (Service) TagUpdate

func (r Service) TagUpdate(ctx context.Context, tag serviceitems.TagUpdate) (newid int, userErrors []UserError, internalError error)

func (Service) TaskGet

func (r Service) TaskGet(ctx context.Context, id int) (task *serviceitems.Task, internalError error)

func (Service) TaskList

func (r Service) TaskList(ctx context.Context, option serviceitems.TaskSearchOption) (tasks []*serviceitems.Task, internalError error)

func (Service) TaskUpdate

func (r Service) TaskUpdate(ctx context.Context, task serviceitems.TaskUpdate) (id int, userErrors []UserError, internalError error)

func (Service) TestMADRSAnswer

func (r Service) TestMADRSAnswer(ctx context.Context, answers serviceitems.TestMADRSAnswers) (userError []UserError, internalError error)

func (Service) WeightList

func (r Service) WeightList(ctx context.Context) (l []*serviceitems.Weight, internalError error)

func (Service) WeightUpdate

func (r Service) WeightUpdate(ctx context.Context, w serviceitems.WeightAdd) (userError []UserError, internalError error)

type UserError

type UserError struct {
	Field string `json:"field"`
	Msg   string `json:"msg"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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