cache

package
v0.0.0-...-fa273ca Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Drives  = "drives"
	Exclude = "exclude"
	Expiry  = "expiry"
	MaxUse  = "maxuse"
	Quota   = "quota"

	EnvCacheState               = "MINIO_CACHE_STATE"
	EnvCacheDrives              = "MINIO_CACHE_DRIVES"
	EnvCacheExclude             = "MINIO_CACHE_EXCLUDE"
	EnvCacheExpiry              = "MINIO_CACHE_EXPIRY"
	EnvCacheMaxUse              = "MINIO_CACHE_MAXUSE"
	EnvCacheQuota               = "MINIO_CACHE_QUOTA"
	EnvCacheEncryptionMasterKey = "MINIO_CACHE_ENCRYPTION_MASTER_KEY"

	DefaultExpiry = "90"
	DefaultQuota  = "80"
)

Cache ENVs

Variables

View Source
var (
	DefaultKVS = config.KVS{
		config.State:   config.StateOff,
		config.Comment: "This is a default cache configuration, only applicable in gateway setups",
		Drives:         "",
		Exclude:        "",
		Expiry:         DefaultExpiry,
		Quota:          DefaultQuota,
	}
)

DefaultKVS - default KV settings for caching.

View Source
var (
	Help = config.HelpKV{
		Drives:         `List of mounted drives or directories delimited by ";"`,
		Exclude:        `List of wildcard based cache exclusion patterns delimited by ";"`,
		Expiry:         `Cache expiry duration in days. eg: "90"`,
		Quota:          `Maximum permitted usage of the cache in percentage (0-100)`,
		config.State:   "Indicates if caching is enabled or not",
		config.Comment: "A comment to describe the caching setting",
	}
)

Help template for caching feature.

Functions

func SetCacheConfig

func SetCacheConfig(s config.Config, cfg Config)

SetCacheConfig - One time migration code needed, for migrating from older config to new for Cache.

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"`
}

Config represents cache config settings

func LookupConfig

func LookupConfig(kvs config.KVS) (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