Documentation ¶
Index ¶
- func GetErrorFromStatus(status int32) error
- type CellIDs
- type Feed
- type InvalidSessionError
- type Location
- type RPC
- type Reporter
- type RequestError
- type RequiresAuthorizationError
- type RequiresRPCEndpointError
- type Session
- func (s *Session) Announce() (mapObjects *protos.GetMapObjectsResponse, err error)
- func (s *Session) Call(requests []*protos.Request) (*protos.ResponseEnvelope, error)
- func (s *Session) GetInventory() (*protos.GetInventoryResponse, error)
- func (s *Session) GetPlayer() (*protos.GetPlayerResponse, error)
- func (s *Session) GetPlayerMap() (*protos.GetMapObjectsResponse, error)
- func (s *Session) Init() error
- func (s *Session) MoveTo(location *Location)
- func (s *Session) SetTimeout(d time.Duration)
- func (s *Session) SetTransport(t http.RoundTripper)
- type VoidReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetErrorFromStatus ¶
GetErrorFromStatus will, depending on the status code, give you an error or nil if there is no error
Types ¶
type Feed ¶
type Feed struct {
// contains filtered or unexported fields
}
Feed is an intermediary that holds a buffer of encountered game items and a reporter to notify about them
type InvalidSessionError ¶
type InvalidSessionError struct{}
InvalidSessionError happens when the session token has expired or been invalidated
func (*InvalidSessionError) Error ¶
func (e *InvalidSessionError) Error() string
type Location ¶
Location consists of coordinates in longitude, latitude and altitude
func (*Location) DistanceToFort ¶
DistanceToFort returns distance between the location and a fort using the Haversine formula Reference: https://gist.github.com/cdipaolo/d3f8db3848278b49db68
func (*Location) GetCellIDs ¶
GetCellIDs will return a slice of the closed neighbourhood cell ids for the current coordinates
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
RPC is used to communicate with the Pokémon Go API
type Reporter ¶
type Reporter interface { WildPokemons([]*protos.WildPokemon) Forts([]*protos.FortData) }
Reporter is a common interface for collecting findings
type RequestError ¶
type RequestError struct{}
RequestError happens when there's an error that is not accounted for
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type RequiresAuthorizationError ¶
type RequiresAuthorizationError struct{}
RequiresAuthorizationError happens when the API wants you to re-authorize the profile
func (*RequiresAuthorizationError) Error ¶
func (e *RequiresAuthorizationError) Error() string
type RequiresRPCEndpointError ¶
type RequiresRPCEndpointError struct{}
RequiresRPCEndpointError happens when an invalid session endpoint has been used
func (*RequiresRPCEndpointError) Error ¶
func (e *RequiresRPCEndpointError) Error() string
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is used to communicate with the Pokémon Go API
func NewSession ¶
NewSession constructs a Pokémon Go RPC API client
func (*Session) GetInventory ¶
GetInventory returns the player items
func (*Session) GetPlayerMap ¶
GetPlayerMap returns the surrounding map cells
func (*Session) SetTimeout ¶
func (*Session) SetTransport ¶
func (s *Session) SetTransport(t http.RoundTripper)
type VoidReporter ¶
type VoidReporter struct{}
VoidReporter sends any reported entries in to the void
func (*VoidReporter) Forts ¶
func (r *VoidReporter) Forts([]*protos.FortData)
Forts accepts wirld forts in to the void
func (*VoidReporter) WildPokemons ¶
func (r *VoidReporter) WildPokemons([]*protos.WildPokemon)
WildPokemons accepts wild pokémons in to the void