api

package
v0.0.0-...-080ad10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntitlementMinecraftProduct        = "product_minecraft"
	EntitlementMinecraftGame           = "game_minecraft"
	EntitlementMinecraftBedrockProduct = "product_minecraft_bedrock"
	EntitlementMinecraftBedrockGame    = "game_minecraft_bedrock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Path             string `json:"path"`
	ErrorType        string `json:"errorType"`
	ErrorCode        string `json:"error"`
	ErrorMessage     string `json:"errorMessage"`
	DeveloperMessage string `json:"developerMessage"`
}

func (*APIError) Error

func (e *APIError) Error() string

type AuthResponse

type AuthResponse struct {
	Username    string        `json:"username"`
	Roles       []interface{} `json:"roles"`
	AccessToken string        `json:"access_token"`
	TokenType   string        `json:"token_type"`
	ExpiresIn   int           `json:"expires_in"`
}

func LoginWithXbox

func LoginWithXbox(userHash string, xstsToken string) (*AuthResponse, error)

type AuthorizedAPI

type AuthorizedAPI struct {
	// contains filtered or unexported fields
}

func NewAuthorizedAPI

func NewAuthorizedAPI(token string) AuthorizedAPI

func (*AuthorizedAPI) GetEntitlements

func (a *AuthorizedAPI) GetEntitlements() (*EntitlementsResponse, error)

func (*AuthorizedAPI) GetProfile

func (a *AuthorizedAPI) GetProfile() (*Profile, error)

type Entitlement

type Entitlement struct {
	Name   string `json:"name"`
	Source string `json:"source"`
}

type EntitlementsResponse

type EntitlementsResponse struct {
	Items     []Entitlement `json:"items"`
	Signature string        `json:"signature"`
	KeyId     string        `json:"keyId"`
	RequestId string        `json:"requestId"`
}

func (*EntitlementsResponse) ReadSignature

func (r *EntitlementsResponse) ReadSignature() (jwt.Token, error)

type Profile

type Profile struct {
	ID    string    `json:"id"`
	Name  string    `json:"name"`
	Skins []Skin    `json:"skins"`
	Capes []Texture `json:"capes"`
}

type Skin

type Skin struct {
	Texture
	Variant string
}

type Texture

type Texture struct {
	ID    string `json:"id"`
	State string `json:"state"`
	URL   string `json:"url"`
	Alias string `json:"alias"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL