You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: compress.go
    path of file: ./repos/minio/internal/config/compress
    
    the code of the file until where you have to start completion: // Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms o
    
func LookupConfig(kvs config.KVS) (Config, error) {
	var err error
	cfg := Config{}
	if err = config.CheckValidKeys(config.CompressionSubSys, kvs, DefaultKVS); err != nil {
		return cfg, err
	}

	compress := env.Get(EnvCompressState, kvs.Get(config.Enable))
	if compress == "" {
		compress = env.Get(EnvCompress, "")
	}
	cfg.Enabled, err = config.ParseBool(compress)
	if err != nil {
		// Parsing failures happen due to empty KVS, ignore it.
		if kvs.Empty() {
			return cfg, nil
		}
		return cfg, err
	}
	if !cfg.Enabled {
		return cfg, nil
	}

	allowEnc := env.Get(EnvCompressAllowEncryption, kvs.Get(AllowEncrypted))
	if allowEnc == "" {
		allowEnc = env.Get(EnvCompressAllowEncryptionLegacy, "")
	}

	cfg.AllowEncrypted, err = config.ParseBool(allowEnc)
	if err != nil {
		return cfg, err
	}

	compressExtensions := env.Get(EnvCompressExtensions, kvs.Get(Extensions))
	compressExtensionsLegacy := env.Get(EnvCompressExtensionsLegacy, "")
	compressMimeTypes := env.Get(EnvCompressMimeTypes, kvs.Get(MimeTypes))
	compressMimeTypesLegacy1 := env.Get(EnvCompressMimeTypesLegacy1, "")
	compressMimeTypesLegacy2 := env.Get(EnvCompressMimeTypesLegacy2, "")
	if compressExtensions != "" {
		extensions, err := parseCompressIncludes(compressExtensions)
		if err != nil {
			return cfg, fmt.Errorf("%s: Invalid MINIO_COMPRESSION_EXTENSIONS value (`%s`)", err, extensions)
		}
		cfg.Extensions = extensions
	}

	if compressExtensionsLegacy != "" {
		extensions, err := parseCompressIncludes(compressExtensions)
		if err != nil {
			return cfg, fmt.Errorf("%s: Invalid MINIO_COMPRESS_EXTENSIONS value (`%s`)", err, extensions)
		}
		cfg.Extensions = extensions
	}

	if compressMimeTypes != "" {
		mimeTypes, err := parseCompressIncludes(compressMimeTypes)
		if err != nil {
			return cfg, fmt.Errorf("%s: Invalid MINIO_COMPRESSION_MIME_TYPES value (`%s`)", err, mimeTypes)
		}
		cfg.MimeTypes = mimeTypes
	}

	if compressMimeTypesLegacy1 != "" {
		mimeTypes, err := parseCompressIncludes(compressMimeTypesLegacy1)
		if err != nil {
			return cfg, fmt.Errorf("%s: Invalid MINIO_COMPRESS_MIMETYPES value (`%s`)", err, mimeTypes)
		}
		cfg.MimeTypes = mimeTypes
	}

	if compressMimeTypesLegacy2 != "" {
		mimeTypes, err := parseCompressIncludes(compressMimeTypesLegacy2)
		if err != nil {
			return cfg, fmt.Errorf("%s: Invalid MINIO_COMPRESS_MIME_TYPES value (`%s`)", err, mimeTypes)
		}
		cfg.MimeTypes = mimeTypes
	}

	return cfg, nil
}