{"modulePath":"github.com/pushchain/push-chain-node","version":"v0.0.12","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\n## Types\n\n```go\ntype Cache struct {\n\t// contains filtered or unexported fields\n}\n```\nCache is a thread-safe store for chain configs. Data can only be changed via UpdateChains.\n\n```go\nfunc New(logger zerolog.Logger) *Cache\n```\nNew creates a new Cache instance.\n\n```go\nfunc (c *Cache) GetAllChains() []*ChainData\n```\nGetAllChains returns a slice copy of all chain data.\n\n```go\nfunc (c *Cache) GetChainData(chainID string) *ChainData\n```\nGetChainData returns a pointer copy of a chain's data, safe for reading. If not found, returns nil.\n\n```go\nfunc (c *Cache) LastUpdated() time.Time\n```\nLastUpdated returns the last time the cache was refreshed.\n\n```go\nfunc (c *Cache) UpdateChains(chains []*uregistrytypes.ChainConfig)\n```\nUpdateChains atomically replaces the entire cache.\n\n```go\ntype ChainData struct {\n\tConfig    *uregistrytypes.ChainConfig\n\tUpdatedAt time.Time\n}\n```\nChainData holds a chain config and when it was last updated.\n\n","path":"github.com/pushchain/push-chain-node/universalClient/cache","name":"cache","synopsis":"","isRedistributable":true}
