compress

package
v0.0.0-...-8ff70ea Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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

	EnvCompressState           = "MINIO_COMPRESSION_ENABLE"
	EnvCompressAllowEncryption = "MINIO_COMPRESSION_ALLOW_ENCRYPTION"
	EnvCompressExtensions      = "MINIO_COMPRESSION_EXTENSIONS"
	EnvCompressMimeTypes       = "MINIO_COMPRESSION_MIME_TYPES"

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

Compression environment variables

View Source
const (
	EnvCompress                 = "MINIO_COMPRESS"
	EnvCompressMimeTypesLegacy1 = "MINIO_COMPRESS_MIMETYPES"

	// These envs were wrong but we supported them for a long time
	// so keep them here to support existing deployments.
	EnvCompressAllowEncryptionLegacy = "MINIO_COMPRESS_ALLOW_ENCRYPTION"
	EnvCompressExtensionsLegacy      = "MINIO_COMPRESS_EXTENSIONS"
	EnvCompressMimeTypesLegacy2      = "MINIO_COMPRESS_MIME_TYPES"
)

Legacy envs.

Variables

View Source
var (
	DefaultKVS = config.KVS{
		config.KV{
			Key:   config.Enable,
			Value: config.EnableOff,
		},
		config.KV{
			Key:   AllowEncrypted,
			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:         config.Enable,
			Description: "Enable or disable object compression",
			Type:        "on|off",
			Optional:    true,
			Sensitive:   false,
		},
		config.HelpKV{
			Key:         Extensions,
			Description: `comma separated file extensions` + defaultHelpPostfix(Extensions),
			Optional:    true,
			Type:        "csv",
		},
		config.HelpKV{
			Key:         MimeTypes,
			Description: `comma separated wildcard mime-types` + defaultHelpPostfix(MimeTypes),
			Optional:    true,
			Type:        "csv",
		},
		config.HelpKV{
			Key:         AllowEncrypted,
			Description: `enable 'encryption' along with compression`,
			Optional:    true,
			Type:        "on|off",
		},
		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"`
	AllowEncrypted bool     `json:"allow_encryption"`
	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