Documentation
¶
Index ¶
Constants ¶
View Source
const ( // UserAgent is HTTP User-Agent Header UserAgent = "gostapi/1.0" // BaseURL for STAPI BaseURL = "http://stapi.co/api" // BaseVersion for STAPI BaseVersion = "v1/rest" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Character ¶
type Character struct {
UID string `json:"uid"`
Name string `json:"name"`
Gender string `json:"gender"`
YearOfBirth uint64 `json:"yearOfBirth"`
MonthOfBirth uint64 `json:"monthOfBirth"`
DayOfBirth uint64 `json:"dayOfBirth"`
PlaceOfBirth string `json:"placeOfBirth"`
YearOfDeath uint64 `json:"yearOfDeath"`
MonthOfDeath uint64 `json:"monthOfDeath"`
DayOfDeath uint64 `json:"dayOfDeath"`
PlaceOfDeath string `json:"placeOfDeath"`
Height uint64 `json:"height"`
Weight uint64 `json:"weight"`
Deceased bool `json:"deceased"`
BloodType string `json:"bloodType"`
MaritalStatus string `json:"maritalStatus"`
SerialNumber string `json:"serialNumber"`
HologramActivationDate string `json:"hologramActivationDate"`
HologramStatus string `json:"hologramStatus"`
HologramDateStatus string `json:"hologramDateStatus"`
Hologram bool `json:"hologram"`
FictionalCharacter bool `json:"fictionalCharacter"`
Mirror bool `json:"mirror"`
AlternateReality bool `json:"alternateReality"`
CharacterSpecies []CharacterSpecies `json:"characterSpecies,omitempty"`
}
Character represents a STAPI character
type CharacterResource ¶
type CharacterResource struct {
Character *Character `json:"character"`
}
CharacterResource represents the results from character endpoint
type CharacterService ¶
type CharacterService interface {
Search(interface{}) (*CharactersResource, error)
Get(interface{}) (*Character, error)
}
CharacterService is an interface for interfacing with the character endpoints of the STAPI.
type CharacterServiceOp ¶
type CharacterServiceOp struct {
// contains filtered or unexported fields
}
CharacterServiceOp handles communication with the character related methods of the STAPI.
func (*CharacterServiceOp) Get ¶
func (c *CharacterServiceOp) Get(options interface{}) (*Character, error)
Get the character
func (*CharacterServiceOp) Search ¶
func (c *CharacterServiceOp) Search(options interface{}) (*CharactersResource, error)
Search the character
type CharacterSpecies ¶
type CharacterSpecies struct {
UID string `json:"uid"`
Name string `json:"name"`
Numerator int `json:"numerator"`
Denominator int `json:"denominator"`
}
CharacterSpecies represents a specie of character
type CharactersResource ¶
type CharactersResource struct {
Page *Page `json:"page"`
Sort *Sort `json:"sort"`
Characters []Character `json:"characters"`
}
CharactersResource is the result from /search endpoint
type Clause ¶
type Clause struct {
Name string `json:"name"`
Direction string `json:"direction"`
ClauseOrder uint64 `json:"clauseOrder"`
}
Clause model, child of Sort
type Client ¶
type Client struct {
Character CharacterService
// contains filtered or unexported fields
}
Client manages communication with the STAPI Rest API.
type Page ¶
type Page struct {
PageNumber uint64 `json:"pageNumber"`
PageSize uint64 `json:"pageSize"`
NumberOfElements uint64 `json:"numberOfElements"`
TotalElements uint64 `json:"totalElements"`
TotalPages uint64 `json:"totalPages"`
FirstPage bool `json:"firstPage"`
LastPage bool `json:"lastPage"`
}
Page represents pagination for STAPI
Click to show internal directories.
Click to hide internal directories.