Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentData ¶
type ReadWrapper ¶
type ReadWrapper struct { Data []PaymentData `json:"data"` Links ReadWrapperLinks `json:"links"` }
ReadWrapper adds some extra information around Payment structs that are read from the API.
func (*ReadWrapper) AddPayment ¶
func (rw *ReadWrapper) AddPayment(id uuid.UUID, p storage.Payment)
AddPayment will add a Payment with some other boilerplate attributes to a ReadWrapper.
type ReadWrapperLinks ¶
type ReadWrapperLinks struct {
Self string `json:"self"`
}
type Server ¶
type Server struct { Router *chi.Mux Storage storage.PaymentStorage }
Server is a RESTful HTTP API server offering CRUD functionality to store Payments.
type StorageType ¶
type StorageType byte
StorageType is an enum to differentiate between storage implementations.
const ( // InMemory describes a storage system that is held in memory only, and not persisted to disk. InMemory StorageType = iota // Mongo describes a storage system that persists Payment records in a MongoDB database. Mongo )
Click to show internal directories.
Click to hide internal directories.