Documentation ¶
Index ¶
Constants ¶
View Source
const ContentTypeHTML = "HTML"
View Source
const ContentTypeSimple = "SIMPLE"
View Source
const ProductStatusArchived = "ARCHIVED"
View Source
const ProductStatusAvailable = "AVAILABLE"
Variables ¶
View Source
var ErrInvalidEntity = errors.New("invalid entity")
ErrInvalidEntity indicates the provided entity is invalid
View Source
var ErrInvalidID = errors.New("invalid id")
ErrInvalidID indicates the provided id is malformed
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound indicates the requested entity is not found
Functions ¶
Types ¶
type Category ¶
type Category struct { ID ID Name string Description string // ID of the parent. // uuid.Nil means it's a root category ParentID ID // Order (priority) of the category. // 1 = highest, inf = lowest Order int ProductIDs []ID Image *Image }
Category data
type Content ¶ added in v0.3.0
type Content struct { Name string ContentType ContentType Body string }
Content data
type ContentType ¶ added in v0.3.0
type ContentType string
func (ContentType) IsValid ¶ added in v0.3.0
func (contentType ContentType) IsValid() bool
func (ContentType) String ¶ added in v0.3.0
func (contentType ContentType) String() string
type Event ¶ added in v0.3.0
type Event struct { ID ID Name string Description string EventType string Start time.Time End time.Time WholeDay bool }
Event data
type GoComError ¶
type GoComError struct { // HTTP status code Status int `json:"status"` // Original error Err error `json:"-"` // Error code Code string `json:"code"` // Human-readable description of the error Message string `json:"message"` // Optional - On which object to error occurred Instance string `json:"instance"` }
GoComError allows to bundle a status with the original error. This allows to fine-grained response codes at the API level.
func (*GoComError) Error ¶
func (e *GoComError) Error() string
type Image ¶
func (*Image) SetURLsFromConfigs ¶
func (img *Image) SetURLsFromConfigs(service imageproxy.Service, configs map[string]imageproxy.ImageConfig) error
SetURLsFromConfigs generates and sets an URL from the provided config
type Manufacturer ¶
Manufacturer data
func (*Manufacturer) Validate ¶
func (m *Manufacturer) Validate() error
Validate validates the manufacturer data
type Product ¶
type Product struct { ID ID CreatedAt time.Time UpdatedAt time.Time Name string DescriptionShort string DescriptionLong string // Price of a single product in cents (1/100) Price int CategoryIDs []ID ManufacturerID ID Status ProductStatus StockCount int Images []*Image }
Product data
type ProductStatus ¶
type ProductStatus string
func (ProductStatus) String ¶
func (status ProductStatus) String() string
type ResolvedProduct ¶
type ResolvedProduct struct { Product Manufacturer *Manufacturer Categories []*Category }
ResolvedProduct is a product for which related entities are included. This way all information is immediately at hand.
Click to show internal directories.
Click to hide internal directories.