api

package
v0.0.0-...-f525512 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(r *mux.Router, prefix string)

Setup the API request routing for list handling and the list storage.

Types

type Item

type Item struct {
	ID       string `json:"id"`
	Name     string `json:"name,omitempty"`
	Link     string `json:"link,omitempty"`
	Assigned bool   `json:"assigned,omitempty"`
}

Item represents a single entry in a giftlist.

type List

type List struct {
	ID    string `json:"id"`
	Name  string `json:"name,omitempty"`
	Items []Item `json:"items,omitempty"`
}

List stores the information of a giftlist.

type Storage

type Storage interface {
	GetList(id string) (*List, error)
	StoreList(l *List) error
}

Storage describes the used interface for storing and retrieving lists for the API to use.

Jump to

Keyboard shortcuts

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