compress

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Extensions = "extensions"
	MimeTypes  = "mime_types"

	EnvCompressState      = "MINIO_COMPRESS_ENABLE"
	EnvCompressExtensions = "MINIO_COMPRESS_EXTENSIONS"
	EnvCompressMimeTypes  = "MINIO_COMPRESS_MIME_TYPES"

	// Include-list for compression.
	DefaultExtensions = ".txt,.log,.csv,.json,.tar,.xml,.bin"
	DefaultMimeTypes  = "text/*,application/json,application/xml"
)

Compression environment variables

View Source
const (
	EnvCompress                = "MINIO_COMPRESS"
	EnvCompressMimeTypesLegacy = "MINIO_COMPRESS_MIMETYPES"
)

Legacy envs.

Variables

View Source
var (
	DefaultKVS = config.KVS{
		config.KV{
			Key:   config.Enable,
			Value: config.EnableOff,
		},
		config.KV{
			Key:   Extensions,
			Value: DefaultExtensions,
		},
		config.KV{
			Key:   MimeTypes,
			Value: DefaultMimeTypes,
		},
	}
)

DefaultKVS - default KV config for compression settings

View Source
var (
	Help = config.HelpKVS{
		config.HelpKV{
			Key:         Extensions,
			Description: `comma separated file extensions e.g. ".txt,.log,.csv"`,
			Optional:    true,
			Type:        "csv",
		},
		config.HelpKV{
			Key:         MimeTypes,
			Description: `comma separated wildcard mime-types e.g. "text/*,application/json,application/xml"`,
			Optional:    true,
			Type:        "csv",
		},
		config.HelpKV{
			Key:         config.Comment,
			Description: config.DefaultComment,
			Optional:    true,
			Type:        "sentence",
		},
	}
)

Help template for compress feature.

Functions

func SetCompressionConfig

func SetCompressionConfig(s config.Config, cfg Config)

SetCompressionConfig - One time migration code needed, for migrating from older config to new for Compression.

Types

type Config

type Config struct {
	Enabled    bool     `json:"enabled"`
	Extensions []string `json:"extensions"`
	MimeTypes  []string `json:"mime-types"`
}

Config represents the compression settings.

func LookupConfig

func LookupConfig(kvs config.KVS) (Config, error)

LookupConfig - lookup compression config.

Jump to

Keyboard shortcuts

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