Documentation
¶
Index ¶
- type CardAPI
- func (api *CardAPI) BaseURL() string
- func (api *CardAPI) Client() *client.HTTPClient
- func (api *CardAPI) DeleteCard(uuid string, owner string) (*apiModels.APIResponse, error)
- func (api *CardAPI) GetCard(uuid string, owner string) (*cardModel.CardSet, error)
- func (api *CardAPI) IndexCards() (*[]*cardModel.CardSet, error)
- func (api *CardAPI) NewCard(card *cardModel.CardSet, owner string) (*apiModels.APIResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CardAPI ¶ added in v1.2.0
type CardAPI struct {
// contains filtered or unexported fields
}
CardAPI A representation of the card namespace for the MTGJSON API
func New ¶ added in v1.1.1
func New(baseURL string, client *client.HTTPClient) *CardAPI
New Create a new instance of the CardAPI struct
func (*CardAPI) BaseURL ¶ added in v1.2.0
BaseURL - Returns the baseUrl with its associating endpoint attached to it, used for making HTTP requests
func (*CardAPI) Client ¶ added in v1.2.0
func (api *CardAPI) Client() *client.HTTPClient
Client - Returns a pointer to the client.HTTPClient structure that is used for HTTP requests
func (*CardAPI) DeleteCard ¶ added in v1.2.0
DeleteCard Remove a card from the MongoDB database. The UUID passed in the parameter must be a valid MTGJSONv4 ID. ErrNoCard will be returned if no card exists under the passed UUID, and ErrCardDeleteFailed will be returned if the deleted count does not equal 1
func (*CardAPI) GetCard ¶ added in v1.2.0
GetCard Takes a single string representing an MTGJSONv4 UUID and return a card model for it
func (*CardAPI) IndexCards ¶ added in v1.2.0
IndexCards Returns all cards in the database unmarshalled as card models. The limit parameter will be passed directly to the database query to limit the number of models returned