Documentation ¶
Index ¶
- Constants
- Variables
- func Cipher(algo cipher.Algorithm, mode cipher.Mode, key, iv []byte) utils.OptionFunc[option]
- func Compress(algo compress.Algorithm) utils.OptionFunc[option]
- func Encode(algo Algorithm) utils.OptionFunc[option]
- func NewDecodeFunc(algo Algorithm) func([]byte) ([]byte, error)
- func NewEncodeFunc(algo Algorithm) func([]byte) ([]byte, error)
- func NewReader(algo Algorithm, r io.Reader) io.Reader
- func NewWriter(algo Algorithm, w io.Writer) io.Writer
- type Algorithm
- type Codecable
- type EncodedType
- type Streamable
Constants ¶
View Source
const (
RndSeed int64 = -6544809196299914340
)
Variables ¶
View Source
var ( ErrUnknownAlgorithm = errors.New("unknown encode algorithm") ErrEncodeMethodNotFound = errors.New("not found encode method") )
Functions ¶
func Encode ¶
func Encode(algo Algorithm) utils.OptionFunc[option]
Types ¶
type Codecable ¶
type Codecable interface { Encode(opts ...utils.OptionExtender) Codecable Decode(opts ...utils.OptionExtender) Codecable ToBytes() (dst []byte, err error) ToString() (dst string, err error) }
type EncodedType ¶
type EncodedType int8
const ( EncodedTypeUnknown EncodedType = iota EncodedTypeCipher EncodedTypeCompress EncodedTypeEncode )
func ParseEncodedType ¶
func ParseEncodedType(s any) EncodedType
func (EncodedType) IsValid ¶
func (e EncodedType) IsValid() bool
func (EncodedType) String ¶
func (e EncodedType) String() string
func (EncodedType) Value ¶
func (e EncodedType) Value() uint8
type Streamable ¶
type Streamable interface { Encode(dst io.Writer, src io.Reader) (n int64, err error) Decode(dst io.Writer, src io.Reader) (n int64, err error) }
func NewCodecStream ¶
func NewCodecStream(opts ...utils.OptionExtender) Streamable
Click to show internal directories.
Click to hide internal directories.