util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesCompression

type BytesCompression interface {
	Compress([]byte) ([]byte, error)

	Decompress([]byte) ([]byte, error)

	// String returns name of the algorithm.
	String() string
}

BytesCompression is an interface of algorithm for compressing bytes.

func NewCompression

func NewCompression(name string) BytesCompression

NewCompression returns nil if the given name is invalid.

type Encoder

type Encoder interface {
	// encode string into a bytes
	EncodeAll(string) ([]byte, error)

	// decode from bytes to string
	DecodeAll([]byte) (string, error)

	// String returns name of the encoding.
	String() string
}

func NewEncoder

func NewEncoder(name string) Encoder

NewEncoder returns nil if the given name is invalid.

Jump to

Keyboard shortcuts

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