zstd

package module
v0.0.0-...-ee2d11e Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

README

go-zstd

libzstd wrapper using ebitengine/purego

WIP

LICENSE

BSD-3

Documentation

Overview

Code generated by internal/cenum2go/main.go DO NOT EDIT.

Code generated by internal/cenum2go/main.go DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptySrc = errors.New("zstd: empty src byte slice")
)

Functions

func Compress

func Compress(dst []byte, src []byte, level int) ([]byte, error)

func CompressBound

func CompressBound(srcSize int) int

func Decompress

func Decompress(dst []byte, src []byte) ([]byte, error)

func DefaultCLevel

func DefaultCLevel() int

func FindFrameCompressedSize

func FindFrameCompressedSize(src []byte) int

func GetFrameContentSize

func GetFrameContentSize(src []byte) int64

func InitWithBin

func InitWithBin(bin []byte) (*zstdLib, error)

func InitWithEmbed

func InitWithEmbed() (*zstdLib, error)

func InitWithPath

func InitWithPath(dlpath string) (*zstdLib, error)

func InitWithSystemLibrary

func InitWithSystemLibrary() (*zstdLib, error)

func MaxCLevel

func MaxCLevel() int

func MinCLevel

func MinCLevel() int

func VersionNumber

func VersionNumber() uint

func VersionString

func VersionString() string

Types

type CCtx

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

func CreateCCtx

func CreateCCtx() *CCtx

func (*CCtx) Compress

func (cctx *CCtx) Compress(dst []byte, src []byte, level int) ([]byte, error)

type DCtx

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

func (*DCtx) Decompress

func (dctx *DCtx) Decompress(dst []byte, src []byte) ([]byte, error)

type Error

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

func (Error) Code

func (e Error) Code() ZSTD_ErrorCode

func (Error) Error

func (e Error) Error() string

type ZSTD_ErrorCode

type ZSTD_ErrorCode int
const (
	ZSTD_ErrorCode_no_error                        ZSTD_ErrorCode = 0
	ZSTD_ErrorCode_error_GENERIC                   ZSTD_ErrorCode = 1
	ZSTD_ErrorCode_prefix_unknown                  ZSTD_ErrorCode = 10
	ZSTD_ErrorCode_version_unsupported             ZSTD_ErrorCode = 12
	ZSTD_ErrorCode_frameParameter_unsupported      ZSTD_ErrorCode = 14
	ZSTD_ErrorCode_frameParameter_windowTooLarge   ZSTD_ErrorCode = 16
	ZSTD_ErrorCode_corruption_detected             ZSTD_ErrorCode = 20
	ZSTD_ErrorCode_checksum_wrong                  ZSTD_ErrorCode = 22
	ZSTD_ErrorCode_literals_headerWrong            ZSTD_ErrorCode = 24
	ZSTD_ErrorCode_dictionary_corrupted            ZSTD_ErrorCode = 30
	ZSTD_ErrorCode_dictionary_wrong                ZSTD_ErrorCode = 32
	ZSTD_ErrorCode_dictionaryCreation_failed       ZSTD_ErrorCode = 34
	ZSTD_ErrorCode_parameter_unsupported           ZSTD_ErrorCode = 40
	ZSTD_ErrorCode_combination_unsupported         ZSTD_ErrorCode = 41
	ZSTD_ErrorCode_parameter_outOfBound            ZSTD_ErrorCode = 42
	ZSTD_ErrorCode_tableLog_tooLarge               ZSTD_ErrorCode = 44
	ZSTD_ErrorCode_maxSymbolValue_tooLarge         ZSTD_ErrorCode = 46
	ZSTD_ErrorCode_maxSymbolValue_tooSmall         ZSTD_ErrorCode = 48
	ZSTD_ErrorCode_stabilityCondition_notRespected ZSTD_ErrorCode = 50
	ZSTD_ErrorCode_stage_wrong                     ZSTD_ErrorCode = 60
	ZSTD_ErrorCode_init_missing                    ZSTD_ErrorCode = 62
	ZSTD_ErrorCode_memory_allocation               ZSTD_ErrorCode = 64
	ZSTD_ErrorCode_workSpace_tooSmall              ZSTD_ErrorCode = 66
	ZSTD_ErrorCode_dstSize_tooSmall                ZSTD_ErrorCode = 70
	ZSTD_ErrorCode_srcSize_wrong                   ZSTD_ErrorCode = 72
	ZSTD_ErrorCode_dstBuffer_null                  ZSTD_ErrorCode = 74
	ZSTD_ErrorCode_noForwardProgress_destFull      ZSTD_ErrorCode = 80
	ZSTD_ErrorCode_noForwardProgress_inputEmpty    ZSTD_ErrorCode = 82
	ZSTD_ErrorCode_frameIndex_tooLarge             ZSTD_ErrorCode = 100
	ZSTD_ErrorCode_error_seekableIO                ZSTD_ErrorCode = 102
	ZSTD_ErrorCode_dstBuffer_wrong                 ZSTD_ErrorCode = 104
	ZSTD_ErrorCode_srcBuffer_wrong                 ZSTD_ErrorCode = 105
	ZSTD_ErrorCode_sequenceProducer_failed         ZSTD_ErrorCode = 106
	ZSTD_ErrorCode_externalSequences_invalid       ZSTD_ErrorCode = 107
	ZSTD_ErrorCode_error_maxCode                   ZSTD_ErrorCode = 120
)

type ZSTD_strategy

type ZSTD_strategy int
const (
	ZSTD_strategy_fast     ZSTD_strategy = 1
	ZSTD_strategy_dfast    ZSTD_strategy = 2
	ZSTD_strategy_greedy   ZSTD_strategy = 3
	ZSTD_strategy_lazy     ZSTD_strategy = 4
	ZSTD_strategy_lazy2    ZSTD_strategy = 5
	ZSTD_strategy_btlazy2  ZSTD_strategy = 6
	ZSTD_strategy_btopt    ZSTD_strategy = 7
	ZSTD_strategy_btultra  ZSTD_strategy = 8
	ZSTD_strategy_btultra2 ZSTD_strategy = 9
)

Directories

Path Synopsis
internal
cenum2go command

Jump to

Keyboard shortcuts

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