cache

package
v0.0.0-...-695f612 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Drives        = "drives"
	Exclude       = "exclude"
	Expiry        = "expiry"
	MaxUse        = "maxuse"
	Quota         = "quota"
	After         = "after"
	WatermarkLow  = "watermark_low"
	WatermarkHigh = "watermark_high"

	EnvCacheDrives        = "RADIO_CACHE_DRIVES"
	EnvCacheExclude       = "RADIO_CACHE_EXCLUDE"
	EnvCacheExpiry        = "RADIO_CACHE_EXPIRY"
	EnvCacheMaxUse        = "RADIO_CACHE_MAXUSE"
	EnvCacheQuota         = "RADIO_CACHE_QUOTA"
	EnvCacheAfter         = "RADIO_CACHE_AFTER"
	EnvCacheWatermarkLow  = "RADIO_CACHE_WATERMARK_LOW"
	EnvCacheWatermarkHigh = "RADIO_CACHE_WATERMARK_HIGH"

	DefaultExpiry        = "90"
	DefaultQuota         = "80"
	DefaultAfter         = "0"
	DefaultWaterMarkLow  = "70"
	DefaultWaterMarkHigh = "80"
)

Cache ENVs

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled       bool     `json:"-"`
	Drives        []string `json:"drives"`
	Expiry        int      `json:"expiry"`
	MaxUse        int      `json:"maxuse"`
	Quota         int      `json:"quota"`
	Exclude       []string `json:"exclude"`
	After         int      `json:"after"`
	WatermarkLow  int      `json:"watermark_low"`
	WatermarkHigh int      `json:"watermark_high"`
}

Config represents cache config settings

func LookupConfig

func LookupConfig() (Config, error)

LookupConfig - extracts cache configuration provided by environment variables and merge them with provided CacheConfiguration.

func (*Config) UnmarshalJSON

func (cfg *Config) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON - implements JSON unmarshal interface for unmarshalling json entries for CacheConfig.

Jump to

Keyboard shortcuts

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