Documentation ¶
Index ¶
- Variables
- func GetErrorFromStatus(status protos.ResponseEnvelope_StatusCode) error
- type CellIDs
- type ErrCheckChallengeURL
- type ErrResponse
- type Feed
- type Location
- type ProxyResponse
- type RPC
- type Session
- func (s *Session) Announce(ctx context.Context, proxyId int64) (mapObjects *protos.GetMapObjectsResponse, err error)
- func (s *Session) Call(ctx context.Context, requests []*protos.Request, proxyId int64) (*protos.ResponseEnvelope, error)
- func (s *Session) CheckChallenge(ctx context.Context) (*protos.CheckChallengeResponse, error)
- func (s *Session) Encounter(ctx context.Context, encounterID uint64, spawnID string, loc *Location, ...) (*protos.EncounterResponse, error)
- func (s *Session) GetInventory(ctx context.Context, proxyId int64) (*protos.GetInventoryResponse, error)
- func (s *Session) GetPlayer(ctx context.Context, proxyId int64) (*protos.GetPlayerResponse, error)
- func (s *Session) GetPlayerMap(ctx context.Context, proxyId int64) (*protos.GetMapObjectsResponse, error)
- func (s *Session) Init(ctx context.Context, proxyId int64) error
- func (s *Session) IsExpired() bool
- func (s *Session) MoveTo(location *Location)
- func (s *Session) SetTimeout(d time.Duration)
- func (s *Session) SolveCaptcha(ctx context.Context, solution string) (*protos.VerifyChallengeResponse, error)
- type VoidFeed
Constants ¶
This section is empty.
Variables ¶
var ErrAccountBanned = errors.New("Account is banned")
ErrAccountBanned happens when a request is sent with a banned account
var ErrBadRequest = errors.New("The remote service responded but appear to think the request is malformatted")
ErrBadRequest happens when the remote service thinks the request is malformatted
var ErrCheckChallenge = errors.New("ReCaptcha challenge was sent")
ErrCheckChallenge happens when the account gets flagged for a ReCaptcha challenge
var ErrFormatting = errors.New("Request was malformatted and could not be performed")
ErrFormatting happens when the something in the request body was not right
var ErrInvalidAuthToken = errors.New("The auth token used is not vailid")
ErrInvalidAuthToken happens when the currently used auth token is not vailid
var ErrInvalidPlatformRequest = errors.New("A platform specific request is invalid")
ErrInvalidPlatformRequest happens when a platform specific request like the request signature being incorrect
var ErrInvalidRequest = errors.New("The remote service responded but appear to think the request is invalid")
ErrInvalidRequest happens when the request is invalid
var ErrIpSoftBanned = errors.New("IP is softbanned")
ErrIpSoftBanned happens when a request is sent from a soft banned ip
var ErrNewRPCURL = errors.New("There is a new RPC url in the response, please use the new URL for future requests")
ErrNewRPCURL happens when there is a new RPC url available in the response body
var ErrNoURL = errors.New("The remote service did not respond with a remote URL when expected")
ErrNoURL happens when the remote service is expected to respond with a remote URL but doesn't
var ErrProxyDead = errors.New("Dead proxy")
ErrProxyDead happens when the provided proxy does not respond.
var ErrRedirect = errors.New("The request was redirected")
ErrRedirect happens when an invalid session endpoint has been used
var ErrRequest = errors.New("The remote service responded but the request could not be completed for unknown reasons")
ErrRequest happens when there is an unknown issue with the request
var ErrSessionInvalidated = errors.New("The session has been invalidated")
ErrSessionInvalidated happens when the session has been invalidated by the remote service
var LocalAddr net.Addr
var ProxyHost = ""
Functions ¶
func GetErrorFromStatus ¶
func GetErrorFromStatus(status protos.ResponseEnvelope_StatusCode) error
GetErrorFromStatus will, depending on the status code, give you an error or nil if there is no error
Types ¶
type ErrCheckChallengeURL ¶
type ErrCheckChallengeURL error
type ErrResponse ¶
type ErrResponse struct {
// contains filtered or unexported fields
}
ErrResponse happens when there's something wrong with the response object
func (*ErrResponse) Error ¶
func (e *ErrResponse) Error() string
type Feed ¶
type Feed interface {
// Push is used to put response messages on to the feed
Push(entry interface{})
}
Feed is a common interface to act on encountered
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 ¶
type ProxyResponse ¶
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
RPC is used to communicate with the Pokémon Go API
type Session ¶
type Session struct { RPCID uint64 // contains filtered or unexported fields }
Session is used to communicate with the Pokémon Go API
func NewSession ¶
func NewSession(signer *newcrypto.PogoSignature, provider auth.Provider, location *Location, feed Feed, debug bool) *Session
NewSession constructs a Pokémon Go RPC API client
func (*Session) Announce ¶
func (s *Session) Announce(ctx context.Context, proxyId int64) (mapObjects *protos.GetMapObjectsResponse, err error)
Announce publishes the player's presence and returns the map environment
func (*Session) Call ¶
func (s *Session) Call(ctx context.Context, requests []*protos.Request, proxyId int64) (*protos.ResponseEnvelope, error)
Call queries the Pokémon Go API through RPC protobuf
func (*Session) CheckChallenge ¶
func (*Session) GetInventory ¶
func (s *Session) GetInventory(ctx context.Context, proxyId int64) (*protos.GetInventoryResponse, error)
GetInventory returns the player items
func (*Session) GetPlayerMap ¶
func (s *Session) GetPlayerMap(ctx context.Context, proxyId int64) (*protos.GetMapObjectsResponse, error)
GetPlayerMap returns the surrounding map cells
func (*Session) IsExpired ¶
IsExpired checks the expiration timestamp of the sessions AuthTicket if the session has a ticket and it is still valid, the return value is false if there is no ticket, or the ticket is expired, the return value is true
func (*Session) SetTimeout ¶
SetTimeout sets the client timeout for the RPC API