Documentation ¶
Index ¶
- Constants
- func GetCanonicalName(inNationName string) string
- func IsCorrectVerificationCode(nationName string, verificationCode string) (bool, error)
- type Cache
- type CachedNation
- type CensusScale
- type Nation
- func (nation *Nation) FlagAndName() template.HTML
- func (nation *Nation) FlagThumbnail() template.HTML
- func (nation Nation) FlagThumbnailURL() string
- func (nation *Nation) GetCensusRank(scale int) int
- func (nation *Nation) GetDefenseForces() int
- func (nation *Nation) GetURL() string
- func (nation *Nation) SetCensusRank(percentageRank int, scale int)
- func (nation *Nation) SetDefenseForces(percentageRank int)
- type NationStatesProvider
- type NationStatesProviderAPI
- type NationStatesProviderSimpleMap
- type RateLimiter
Constants ¶
View Source
const CENSUSSCALEDEFENSEFORCES int = 46
View Source
const CENSUSSCALESCIENTIFICADVANCEMENT int = 70
Variables ¶
This section is empty.
Functions ¶
func GetCanonicalName ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type CachedNation ¶
type CachedNation struct {
// contains filtered or unexported fields
}
type CensusScale ¶
type Nation ¶
type Nation struct { Id string `xml:"id,attr"` Name string `xml:"FULLNAME"` FlagURL string `xml:"FLAG"` Demonym string `xml:"DEMONYM"` CensusScales []CensusScale `xml:"CENSUS>SCALE"` }
func GetNationData ¶
func ParseNation ¶
func (*Nation) FlagAndName ¶
func (*Nation) FlagThumbnail ¶
func (Nation) FlagThumbnailURL ¶
func (*Nation) GetCensusRank ¶
func (*Nation) GetDefenseForces ¶
func (*Nation) SetCensusRank ¶
func (*Nation) SetDefenseForces ¶
type NationStatesProvider ¶
type NationStatesProviderAPI ¶
type NationStatesProviderAPI struct { }
func (NationStatesProviderAPI) GetNationData ¶
func (provider NationStatesProviderAPI) GetNationData(nationName string) (*Nation, error)
type NationStatesProviderSimpleMap ¶
func NewNationStatesProviderSimpleMap ¶
func NewNationStatesProviderSimpleMap() NationStatesProviderSimpleMap
func (NationStatesProviderSimpleMap) GetNationData ¶
func (provider NationStatesProviderSimpleMap) GetNationData(nationName string) (*Nation, error)
func (*NationStatesProviderSimpleMap) PutNationData ¶
func (provider *NationStatesProviderSimpleMap) PutNationData(nation Nation)
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(numberOfRequests int, perDuration time.Duration) RateLimiter
func (*RateLimiter) AddRequestTime ¶
func (limiter *RateLimiter) AddRequestTime(curerntTime time.Time)
func (*RateLimiter) IsAtRateLimit ¶
func (limiter *RateLimiter) IsAtRateLimit(currentTime time.Time) bool
Click to show internal directories.
Click to hide internal directories.