compress

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Copyright 2023 Christopher Briscoe. All rights reserved.

Copyright 2023 Christopher Briscoe. All rights reserved.

Copyright 2023 Christopher Briscoe. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Brotli

func Brotli(src []byte, level int) ([]byte, error)

Brotli compresses an []byte given the supplied compression level

func Gzip

func Gzip(src []byte, level int) ([]byte, error)

Gzip compresses an []byte given the supplied compression level

Types

type BrotliPool

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

BrotliPool contains the structure for a brotli pool

func NewBrotliPool

func NewBrotliPool(level int) *BrotliPool

NewBrotliPool creates a new gzip pool at the specified compression level

func (*BrotliPool) Compress

func (p *BrotliPool) Compress(src []byte) ([]byte, error)

Compress compresses the supplied []bytes

type GzipPool

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

GzipPool contains the structure for a gzip pool

func NewGzipPool

func NewGzipPool(level int) *GzipPool

NewGzipPool creates a new gzip pool at the specified compression level

func (*GzipPool) Compress

func (p *GzipPool) Compress(src []byte) ([]byte, error)

Compress compresses the supplied []bytes

type Pool

type Pool interface {
	Compress([]byte) ([]byte, error)
}

Pool is the Compress interface for compression pools of different types.

Jump to

Keyboard shortcuts

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