compress

package
v0.0.0-...-4a740ba Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = er.New(mediatype.New("domain/compress.protocol.error; name=not-found").SetDetail(protocol.LanguageEnglish, domainEnglish,
		"Not Found",
		"Can't find requested compression||decompression algorithm",
		"",
		"",
		nil))

	ErrSourceNotChangeable = er.New(mediatype.New("domain/compress.protocol.error; name=source-not-changeable").SetDetail(protocol.LanguageEnglish, domainEnglish,
		"Source not Changeable",
		"Can't read from other source than source given in compression||decompression creation",
		"",
		"",
		nil))
)

Errors

Functions

func ByContentEncoding

func ByContentEncoding(ce string) protocol.CompressType

func ByFileExtension

func ByFileExtension(ex string) protocol.CompressType

func ByID

func ByID(id uint64) protocol.CompressType

func ByMediaType

func ByMediaType(mt string) protocol.CompressType

func ContentEncodings

func ContentEncodings() []string

Types

type CompressType

type CompressType struct {
	// contains filtered or unexported fields
}

func New

func New(contentEncoding string, mediatype *mediatype.MediaType) (ct *CompressType)

func (*CompressType) ContentEncoding

func (ct *CompressType) ContentEncoding() string

func (*CompressType) FileExtension

func (ct *CompressType) FileExtension() string

func (*CompressType) MediaType

func (ct *CompressType) MediaType() protocol.MediaType

type CompressTypes

type CompressTypes struct{}

CompressTypes store all compress types to use by anyone want protocol.CompressTypes

func (*CompressTypes) ContentEncodings

func (cts *CompressTypes) ContentEncodings() []string

func (*CompressTypes) GetCompressTypeByContentEncoding

func (cts *CompressTypes) GetCompressTypeByContentEncoding(ce string) (ct protocol.CompressType, err protocol.Error)

func (*CompressTypes) GetCompressTypeByFileExtension

func (cts *CompressTypes) GetCompressTypeByFileExtension(ex string) (ct protocol.CompressType, err protocol.Error)

func (*CompressTypes) GetCompressTypeByID

func (cts *CompressTypes) GetCompressTypeByID(id uint64) (ct protocol.CompressType, err protocol.Error)

func (*CompressTypes) GetCompressTypeByMediaType

func (cts *CompressTypes) GetCompressTypeByMediaType(mt string) (ct protocol.CompressType, err protocol.Error)

func (*CompressTypes) RegisterCompressType

func (cts *CompressTypes) RegisterCompressType(ct protocol.CompressType)

RegisterCompressType register given CompressType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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