Documentation ¶
Index ¶
- Constants
- type HTTPSessionManager
- func (h *HTTPSessionManager) APILopin(credential LoginCredential) error
- func (h *HTTPSessionManager) AddKey() error
- func (h *HTTPSessionManager) AddOrDeleteKeysAsNecessary(developerID string) error
- func (h *HTTPSessionManager) DeleteKey(key Key) error
- func (h *HTTPSessionManager) GetClan(ClanTag string) (*clan.Clan, error)
- func (h *HTTPSessionManager) GetClanCurrentRiverRace(ClanTag string) (*clan.CurrentWar, error)
- func (h *HTTPSessionManager) GetClanCurrentWar(ClanTag string) (*clan.CurrentWar, error)
- func (h *HTTPSessionManager) GetClanLabels(args ...map[string]string) (*labels.LabelsData, error)
- func (h *HTTPSessionManager) GetClanMembers(ClanTag string) (*clan.MemberList, error)
- func (h *HTTPSessionManager) GetClanRiverRaceLog(ClanTag string) (*clan.CurrentWar, error)
- func (h *HTTPSessionManager) GetClanWarLog(ClanTag string) (*clan.WarLog, error)
- func (h *HTTPSessionManager) GetIP() error
- func (h *HTTPSessionManager) GetKeys() error
- func (h *HTTPSessionManager) GetLeague(LeagueID string) (*league.League, error)
- func (h *HTTPSessionManager) GetLeagueSeasonInfo(LeagueID string, SeasonID string, args ...map[string]string) (*league.SeasonInfo, error)
- func (h *HTTPSessionManager) GetLeagueSeasons(LeagueID string, args ...map[string]string) (*league.SeasonData, error)
- func (h *HTTPSessionManager) GetLocation(LocationID string) (*location.Location, error)
- func (h *HTTPSessionManager) GetLocationClans(LocationID string, args ...map[string]string) (*location.ClanData, error)
- func (h *HTTPSessionManager) GetLocationClansVersus(LocationID string, args ...map[string]string) (*location.ClanVersusData, error)
- func (h *HTTPSessionManager) GetLocationPlayers(LocationID string, args ...map[string]string) (*location.PlayerData, error)
- func (h *HTTPSessionManager) GetLocationPlayersVersus(LocationID string, args ...map[string]string) (*location.PlayerVersusData, error)
- func (h *HTTPSessionManager) GetPlayer(PlayerTag string) (*player.Player, error)
- func (h *HTTPSessionManager) GetPlayerLabels(args ...map[string]string) (*labels.LabelsData, error)
- func (h *HTTPSessionManager) Post(route string, body string, nested bool) ([]byte, error)
- func (h *HTTPSessionManager) Request(route string, nested bool) ([]byte, error)
- func (h *HTTPSessionManager) SearchClans(args ...map[string]string) (*clan.ClanList, error)
- func (h *HTTPSessionManager) SearchLeagues(args ...map[string]string) (*league.LeagueData, error)
- func (h *HTTPSessionManager) SearchLocations(args ...map[string]string) (*location.LocationData, error)
- func (h *HTTPSessionManager) VerifyPlayerToken(PlayerTag string, Token string) (bool, error)
- func (h *HTTPSessionManager) ViewKeys()
- type Key
- type KeyCreationResponse
- type KeyDeletionResponse
- type KeysList
- type LoginCredential
- type LoginResponse
- type Status
Constants ¶
View Source
const (
BaseUrl = "https://api.clashroyale.com/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPSessionManager ¶
type HTTPSessionManager struct { Credentials []LoginCredential Client *resty.Client KeyNames string KeyCount int CacheMaxSize int LoginResponse LoginResponse KeysList KeysList RawKeysList []Key KeyIndex int IP string WG sync.WaitGroup Mutex sync.RWMutex IsValidKeys bool // contains filtered or unexported fields }
func Initialize ¶
func Initialize(credentials ...map[string]string) *HTTPSessionManager
func (*HTTPSessionManager) APILopin ¶
func (h *HTTPSessionManager) APILopin(credential LoginCredential) error
func (*HTTPSessionManager) AddKey ¶
func (h *HTTPSessionManager) AddKey() error
func (*HTTPSessionManager) AddOrDeleteKeysAsNecessary ¶
func (h *HTTPSessionManager) AddOrDeleteKeysAsNecessary(developerID string) error
func (*HTTPSessionManager) DeleteKey ¶
func (h *HTTPSessionManager) DeleteKey(key Key) error
func (*HTTPSessionManager) GetClan ¶
func (h *HTTPSessionManager) GetClan(ClanTag string) (*clan.Clan, error)
func (*HTTPSessionManager) GetClanCurrentRiverRace ¶
func (h *HTTPSessionManager) GetClanCurrentRiverRace(ClanTag string) (*clan.CurrentWar, error)
func (*HTTPSessionManager) GetClanCurrentWar ¶
func (h *HTTPSessionManager) GetClanCurrentWar(ClanTag string) (*clan.CurrentWar, error)
func (*HTTPSessionManager) GetClanLabels ¶
func (h *HTTPSessionManager) GetClanLabels(args ...map[string]string) (*labels.LabelsData, error)
func (*HTTPSessionManager) GetClanMembers ¶
func (h *HTTPSessionManager) GetClanMembers(ClanTag string) (*clan.MemberList, error)
func (*HTTPSessionManager) GetClanRiverRaceLog ¶
func (h *HTTPSessionManager) GetClanRiverRaceLog(ClanTag string) (*clan.CurrentWar, error)
func (*HTTPSessionManager) GetClanWarLog ¶
func (h *HTTPSessionManager) GetClanWarLog(ClanTag string) (*clan.WarLog, error)
func (*HTTPSessionManager) GetIP ¶
func (h *HTTPSessionManager) GetIP() error
func (*HTTPSessionManager) GetKeys ¶
func (h *HTTPSessionManager) GetKeys() error
func (*HTTPSessionManager) GetLeague ¶
func (h *HTTPSessionManager) GetLeague(LeagueID string) (*league.League, error)
func (*HTTPSessionManager) GetLeagueSeasonInfo ¶
func (h *HTTPSessionManager) GetLeagueSeasonInfo(LeagueID string, SeasonID string, args ...map[string]string) (*league.SeasonInfo, error)
be cautious when using this. the data returned is massive. recommended to add args of {"limit": limit} and use the cursors for more data
func (*HTTPSessionManager) GetLeagueSeasons ¶
func (h *HTTPSessionManager) GetLeagueSeasons(LeagueID string, args ...map[string]string) (*league.SeasonData, error)
func (*HTTPSessionManager) GetLocation ¶
func (h *HTTPSessionManager) GetLocation(LocationID string) (*location.Location, error)
func (*HTTPSessionManager) GetLocationClans ¶
func (*HTTPSessionManager) GetLocationClansVersus ¶
func (h *HTTPSessionManager) GetLocationClansVersus(LocationID string, args ...map[string]string) (*location.ClanVersusData, error)
func (*HTTPSessionManager) GetLocationPlayers ¶
func (h *HTTPSessionManager) GetLocationPlayers(LocationID string, args ...map[string]string) (*location.PlayerData, error)
func (*HTTPSessionManager) GetLocationPlayersVersus ¶
func (h *HTTPSessionManager) GetLocationPlayersVersus(LocationID string, args ...map[string]string) (*location.PlayerVersusData, error)
func (*HTTPSessionManager) GetPlayer ¶
func (h *HTTPSessionManager) GetPlayer(PlayerTag string) (*player.Player, error)
func (*HTTPSessionManager) GetPlayerLabels ¶
func (h *HTTPSessionManager) GetPlayerLabels(args ...map[string]string) (*labels.LabelsData, error)
func (*HTTPSessionManager) Request ¶
func (h *HTTPSessionManager) Request(route string, nested bool) ([]byte, error)
func (*HTTPSessionManager) SearchClans ¶
func (*HTTPSessionManager) SearchLeagues ¶
func (h *HTTPSessionManager) SearchLeagues(args ...map[string]string) (*league.LeagueData, error)
func (*HTTPSessionManager) SearchLocations ¶
func (h *HTTPSessionManager) SearchLocations(args ...map[string]string) (*location.LocationData, error)
This should be passed ideally with nothing, kwargs aren't necessary here but only for the sake of completeness.
func (*HTTPSessionManager) VerifyPlayerToken ¶
func (h *HTTPSessionManager) VerifyPlayerToken(PlayerTag string, Token string) (bool, error)
Only POST method for the API so far
func (*HTTPSessionManager) ViewKeys ¶
func (h *HTTPSessionManager) ViewKeys()
type Key ¶
type Key struct { ID string `json:"id"` Developerid string `json:"developerId"` Tier string `json:"tier"` Name string `json:"name"` Description string `json:"description"` Origins interface{} `json:"origins"` Scopes []string `json:"scopes"` Cidrranges []string `json:"cidrRanges"` ValidUntil interface{} `json:"validUntil"` Key string `json:"key"` }
type KeyCreationResponse ¶
type KeyDeletionResponse ¶
type LoginCredential ¶
type LoginResponse ¶
type LoginResponse struct { Status Status `json:"status,omitempty"` SessionExpiresInSeconds *int64 `json:"sessionExpiresInSeconds,omitempty"` Auth struct { Uid *string `json:"uid,omitempty"` Token *string `json:"token,omitempty"` Ua interface{} `json:"ua"` IP interface{} `json:"ip"` } `json:"auth,omitempty"` Developer struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Game *string `json:"game,omitempty"` Email *string `json:"email,omitempty"` Tier *string `json:"tier,omitempty"` AllowedScopes interface{} `json:"allowedScopes"` MaxCidrs interface{} `json:"maxCidrs"` PrevLoginTs *string `json:"prevLoginTs,omitempty"` PrevLoginIP *string `json:"prevLoginIp,omitempty"` PrevLoginUa *string `json:"prevLoginUa,omitempty"` } `json:"developer,omitempty"` TemporaryAPIToken string `json:"temporaryAPIToken,omitempty"` SwaggerURL string `json:"swaggerUrl,omitempty"` }
Click to show internal directories.
Click to hide internal directories.