Documentation ¶
Index ¶
- func InitHelper[T msgp.Decodable](ctx context.Context, version string, name string, target *[]T, ...) error
- func LoadRaw[T msgp.Decodable](ctx context.Context, version string, name string, onInit func(count int64), ...) ([]T, error)
- func LoadTranslation(ctx context.Context, version string, language string, name string, ...) (*raw.TranslationFile, error)
- type AssetCache
- type CalculateFunc
- type ComputationCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitHelper ¶
func LoadRaw ¶
func LoadRaw[T msgp.Decodable](ctx context.Context, version string, name string, onInit func(count int64), assetCache AssetCache, hooks ...func(obj T)) ([]T, error)
LoadRaw loads a raw brotli-compressed json dump from remote source
Returns data from cache if found
func LoadTranslation ¶
func LoadTranslation(ctx context.Context, version string, language string, name string, assetCache AssetCache) (*raw.TranslationFile, error)
LoadTranslation loads a raw brotli-compressed json dump from remote source
Returns data from cache if found
Types ¶
type AssetCache ¶
type CalculateFunc ¶
type CalculateFunc[Key comparable, Value any] func(key Key) Value
type ComputationCache ¶
type ComputationCache[Key comparable, Value any] struct { Calculate CalculateFunc[Key, Value] Data map[Key]Value }
func NewComputationCache ¶
func NewComputationCache[Key comparable, Value any](f CalculateFunc[Key, Value]) *ComputationCache[Key, Value]
func (*ComputationCache[Key, Value]) Get ¶
func (c *ComputationCache[Key, Value]) Get(key Key) Value
Click to show internal directories.
Click to hide internal directories.