Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncResponse ¶
AsyncResponse contains the result of an asynchronous API request.
type Nadeo ¶
type Nadeo interface {
AuthenticateUbi(email, password string) error
AuthenticateUbiTicket(ticket string) error
AuthenticateBasic(username, password string) error
AuthenticateBasicEmail(email, password, region string) error
GetTokenInfo() TokenInfo
Get(url string, cacheTime time.Duration) ([]byte, error)
Options(url string, cacheTime time.Duration) ([]byte, error)
Head(url string, cacheTime time.Duration) ([]byte, error)
Post(url string, data []byte) ([]byte, error)
Put(url string, data []byte) ([]byte, error)
Patch(url string, data []byte) ([]byte, error)
Delete(url string) ([]byte, error)
GetUncached(url string) ([]byte, error)
OptionsUncached(url string) ([]byte, error)
HeadUncached(url string) ([]byte, error)
AsyncGet(url string, cacheTime time.Duration) chan AsyncResponse
AsyncOptions(url string, cacheTime time.Duration) chan AsyncResponse
AsyncHead(url string, cacheTime time.Duration) chan AsyncResponse
AsyncPost(url string, data []byte) chan AsyncResponse
AsyncPut(url string, data []byte) chan AsyncResponse
AsyncPatch(url string, data []byte) chan AsyncResponse
AsyncDelete(url string) chan AsyncResponse
AsyncGetUncached(url string) chan AsyncResponse
AsyncOptionsUncached(url string) chan AsyncResponse
AsyncHeadUncached(url string) chan AsyncResponse
CheckRefresh() error
SetUserAgent(userAgent string)
SetLogging(enabled bool)
GetRequestCount() uint64
SetIdempotency(enabled bool)
SetTimeout(timeout time.Duration)
}
Nadeo provides access to Nadeo Services.
func NewNadeoWithAudience ¶
NewNadeoWithAudience creates a new Nadeo object ready for authentication with the given audience.
func NewNadeoWithCoreAndAudience ¶
NewNadeoWithCoreAndAudience creates a new Nadeo object ready for authentication with the given core API base URL and audience.
type TokenInfo ¶
type TokenInfo struct {
Header struct {
Alg string // "HS256"
Env string // "trackmania-prod"
Ver string // "1"
}
Payload struct {
Jti string // Json Web Token ID
Iss string // "NadeoServices"
Iat uint32 // Issued At Time
Rat uint32 // Refresh At Time
Exp uint32 // Expiration time
Aud string // "NadeoLiveServices"
Usg string // "Server"
Sid string // ?? UUID
Sub string // ?? UUID
Aun string // Authenticated login
Rtk bool // false
Pce bool // false
}
Signature []byte
}
TokenInfo contains information about the access token.
Click to show internal directories.
Click to hide internal directories.