cache

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ESI is the ESI client

Functions

func ExpirySubscriber

func ExpirySubscriber(ch <-chan *redis.Message)

func FetchAccessToken

func FetchAccessToken(callerID int32, characterID int32, object model.CachedObject) error

func FetchCharacter

func FetchCharacter(callerID int32, characterID int32, object model.CachedObject) error

func FetchCorporation

func FetchCorporation(callerID int32, corporationID int32, object model.CachedObject) error

func FetchCorporationAssets

func FetchCorporationAssets(callerID int32, corporationID int32, object model.CachedObject) error

func FetchCorporationWallets added in v0.4.0

func FetchCorporationWallets(callerID int32, corporationID int32, object model.CachedObject) error

func FetchMarketPrices

func FetchMarketPrices() (prices map[int32]model.CachedObject, err error)

func FetchPrices

func FetchPrices(regionID int, types []int32) (prices map[string]model.Price, err error)

func FetchSystemCostIndices

func FetchSystemCostIndices() (indices map[int32]model.CachedObject, err error)

func GetAccessToken

func GetAccessToken(characterID int32, accessToken *model.AccessToken) error

func GetAccessTokenForCorporation

func GetAccessTokenForCorporation(corporationID int32, accessToken *model.AccessToken) error

func GetCachedObject

func GetCachedObject(hashKey string, callerID int32, objectID int32, object model.CachedObject, funcType FetchFuncType) (err error)

func GetCharacter

func GetCharacter(characterID int32, character *model.Character) error

func GetCorporation

func GetCorporation(callerID int32, corporationID int32, corporation *model.Corporation) error

func GetCorporationAssets

func GetCorporationAssets(callerID int32, corporationID int32, jobs *model.CorporationAssets) error

func GetCorporationWallets added in v0.4.0

func GetCorporationWallets(callerID int32, corporationID int32, wallets *model.Wallets) error

func GetMarketPrice

func GetMarketPrice(typeID int32) (price *model.MarketPrice, err error)

func GetPrices

func GetPrices(regionID int, types []int32) (prices map[int32]model.Price, err error)

func GetSystemCostIndex

func GetSystemCostIndex(solarSystemID int32) (index *model.SystemCostIndex, err error)

func InitCache

func InitCache(redisAddr string) (err error)

func InitSSO

func InitSSO(clientID string, secretKey string, redirectURI string) bool

func ReadCachedObject

func ReadCachedObject(hashKey string, object model.CachedObject) error

func WriteCachedObject

func WriteCachedObject(object model.CachedObject) error

func WriteCachedObjects

func WriteCachedObjects(objects map[int32]model.CachedObject) error

Types

type FetchFuncType

type FetchFuncType func(callerID int32, objectID int32, object model.CachedObject) error

type ProductTypeResult

type ProductTypeResult struct {
	TypeID     int    `json:"typeID" db:"typeID"`
	TypeName   string `json:"name"`
	CategoryID int    `json:"categoryID"`
	Profit     struct {
		PerDay ProfitValue `json:"perDay"`
	} `json:"profit"`
	Costs struct {
		Total float64 `json:"total"`
	} `json:"costs"`
	HasRequiredSkills bool `json:"hasRequiredSkills"`
}

func GetProductTypes

func GetProductTypes(options *db.SearchOptions, builder model.Character) ([]ProductTypeResult, error)

type ProfitValue

type ProfitValue struct {
	BasedOnBuyPrice  float64 `json:"basedOnBuyPrice" bson:"basedOnBuyPrice"`
	BasedOnSellPrice float64 `json:"basedOnSellPrice" bson:"basedOnSellPrice"`
}

Jump to

Keyboard shortcuts

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