Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
ID string `json:"_id"`
LastUpdated time.Time `json:"lastUpdated"`
CreatedOn time.Time `json:"createdOn"`
Name string `json:"name"`
Slug string `json:"slug"`
SingularName string `json:"singularName"`
}
Collection API contract for CMS collection.
type CollectionItem ¶
type CollectionItem struct {
Archived bool `json:"_archived"`
Draft bool `json:"_draft"`
Name string `json:"name"`
PostBody string `json:"post-body"`
PostSummary string `json:"post-summary"`
Slug string `json:"slug"`
Author string `json:"author"`
Cid string `json:"_cid"`
ID string `json:"_id"`
}
CollectionItem API contract for item(s) in a given collection.
type CollectionItems ¶
type CollectionItems struct {
// Delay parsing until we know the type.
Items json.RawMessage `json:"items"`
Count int `json:"count"`
Limit int `json:"limit"`
Offset int `json:"offset"`
Total int `json:"total"`
}
CollectionItems API contract for retrieving collection items.
type GeneralError ¶
type GeneralError struct {
Msg string `json:"msg"`
Code int `json:"code"`
Name string `json:"name"`
Path string `json:"path"`
Err string `json:"err"`
}
GeneralError API response struct when there is an error.
type Interface ¶
type Interface interface {
MethodGet(uri string, queryParams map[string]string, decodedResponse interface{}) error
GetAllCollections() (*Collections, error)
GetCollectionByName(name string) (*Collection, error)
GetCollectionBySlug(slug string) (*Collection, error)
GetAllItemsInCollectionByID(ID string, maxPages int) ([][]byte, error)
GetAllItemsInCollectionByName(name string, maxPages int) ([][]byte, error)
GetAllItemsInCollectionBySlug(slug string, maxPages int) ([][]byte, error)
GetItem(cName, cSlug, cID, iName, iID string) ([]byte, error)
}
Interface Interface for this package's method. Created primarily for testing your code that depends on this package.