config

package
v0.0.0-...-98cd694 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderMemory is the memory provider.
	ProviderMemory = "memory"
	// ProviderRedis is the redis provider.
	ProviderRedis = "redis"
)

Variables

This section is empty.

Functions

func ProvideCache

func ProvideCache[T cache.Cacheable](cfg *Config) (cache.Cache[T], error)

ProvideCache provides a Cache.

Types

type Config

type Config struct {
	Memory   struct{}      `json:"memory"   toml:"memory"`
	Redis    *redis.Config `json:"redis"    toml:"redis"`
	Provider string        `json:"provider" toml:"provider"`
}

Config is the configuration for the cache.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

Jump to

Keyboard shortcuts

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