Documentation
¶
Index ¶
- func CacheDir() string
- func ExchangeCacheKey(ex types.ExchangeMinimal) string
- func HomeDir() string
- func LoadExchangeMarketsWithCache(ctx context.Context, ex types.ExchangePublic) (markets types.MarketMap, err error)
- func WithCache(key string, obj interface{}, fetcher DataFetcher) error
- type DataFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeCacheKey ¶ added in v1.64.0
func ExchangeCacheKey(ex types.ExchangeMinimal) string
func WithCache ¶
func WithCache(key string, obj interface{}, fetcher DataFetcher) error
WithCache let you use the cache with the given cache key, variable reference and your data fetcher, The key must be an unique ID. obj is the pointer of your local variable fetcher is the closure that will fetch your remote data or some slow operation.
Types ¶
type DataFetcher ¶
type DataFetcher func() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.