client

package
v0.0.0-...-43945a8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	Name string
	URL  string
}

Badge user profile badge

type Character

type Character struct {
	Name            string
	Level           int
	League          string
	Class           string
	AscendancyClass int `json:"ascendancyClass"`
	ClassID         int `json:"classId"`
	Items           []*Item
}

Character profile character

type CharacterItems

type CharacterItems struct {
	Items []*Item `json:"items"`
}

CharacterItems items of the profile character

type Client

type Client struct {
	HTTP    *http.Client
	Logged  bool
	Timeout time.Duration
}

Client client used for all path of exile website applications

func New

func New() (*Client, error)

New returns a new client

func NewTimeout

func NewTimeout(timeout time.Duration) (*Client, error)

NewTimeout returns a new client with the given timeout

func (*Client) ChangePassword

func (c *Client) ChangePassword(current, new string) error

ChangePassword changes the client password

func (*Client) CharacterItems

func (c *Client) CharacterItems(character, account string) ([]*Item, error)

CharacterItems retrieves all items of the given character

func (*Client) GetAccountProfile

func (c *Client) GetAccountProfile(account string) (*Profile, error)

GetAccountProfile retrieves the given account profile

func (*Client) GetDealList

func (c *Client) GetDealList() ([]*Deal, error)

GetDealList returns the list of current running deals

func (*Client) GetInbox

func (c *Client) GetInbox(page int) ([]*PrivateMessage, error)

GetInbox returns the list of private messages

func (*Client) LeagueList

func (c *Client) LeagueList() ([]*League, error)

func (*Client) Login

func (c *Client) Login(email, password string) error

Login logins the given account inside the path of exile website

func (*Client) Logout

func (c *Client) Logout() error

Logout closes the running session Path of Exile website uses a GET request for this task (not the best choice)

func (*Client) ProfileCharacters

func (c *Client) ProfileCharacters(account string) ([]*Character, error)

ProfileCharacters retrieves all the characters of the given account

func (*Client) SendPrivateMessage

func (c *Client) SendPrivateMessage(recipients []string, subject, content string) error

SendPrivateMessage sends a private message to the given recipients

type Deal

type Deal struct {
	Description string
	Name        string
	Price       int
	Video       string
}

Deal represents a website offer

type Item

type Item struct {
	Verified             bool
	Support              bool
	W                    int
	H                    int
	SecondaryDescription string `json:"secDescrText"`
	Description          string `json:"descrText"`
	ItemLevel            int    `json:"ilvl"`
	Icon                 string
	League               string
	ID                   string `json:"id"`
	Name                 string
	TypeLine             string `json:"typeline"`
	Identified           bool
	FrameType            int            `json:"frameType"`
	ImplicitMods         []string       `json:"implicitMods"`
	CraftedMods          []string       `json:"craftedMods"`
	ExplicitMods         []string       `json:"explicitMods"`
	FlavourText          []string       `json:"flavourText"`
	Properties           []ItemProperty `json:"properties"`
	Sockets              []ItemSocket   `json:"sockets"`
}

Item defines a path of exile forum item

func ParseItem

func ParseItem(data []byte) (*Item, error)

ParseItem parses a Path of Exile forum item

type ItemProperty

type ItemProperty struct {
	Name        string
	DisplayMode int `json:"displayMode"`
	Type        int
	Values      [][]interface{}
}

ItemProperty defines a set of item property values

type ItemSocket

type ItemSocket struct {
	Group       int    `json:"group"`
	SocketColor string `json:"sColour"`
}

ItemSocket defines a item socket

type League

type League struct {
	Name string `json:"id"`
	Text string
}

League defines a path of exile active league

type LeagueListResult

type LeagueListResult struct {
	Result []*League
}

LeagueListResult the league list call result

type PrivateMessage

type PrivateMessage struct {
	Unread     bool
	Subject    string
	Sender     string
	ReceivedAt time.Time
	URL        string
}

PrivateMessage represents an account private message

type Profile

type Profile struct {
	GuildName   string
	GuildURL    string
	GuildID     int
	JoinedAt    time.Time
	ForumPosts  int
	LastVisited time.Time
	Badges      []*Badge
	Characters  []*Character
}

Profile website account profile

Jump to

Keyboard shortcuts

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