recordlog

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBufferSizeKB = 16
	DefaultBackup       = 20
	DefaultChunkBits    = 29
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir       string `json:"dir"`
	Backup    int    `json:"backup"`
	ChunkBits uint   `json:"chunkbits"`
}

---------------------------------- recode log encode

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

-------------------------------

func NewDecoder

func NewDecoder(conf *Config) (d Decoder, err error)

type Encoder

type Encoder interface {
	Encode(v interface{}) error
	Close() error
}

func NewEncoder

func NewEncoder(conf *Config) (e Encoder, err error)

type NopEncoder

type NopEncoder struct{}

---------------------- nop encoder

func (*NopEncoder) Close

func (e *NopEncoder) Close() error

func (*NopEncoder) Encode

func (e *NopEncoder) Encode(v interface{}) error

type RecordDecoder

type RecordDecoder struct {
	*RecordLog
	// contains filtered or unexported fields
}

func (*RecordDecoder) Decode

func (e *RecordDecoder) Decode(v interface{}) error

type RecordLog

type RecordLog struct {
	*json.Encoder
	// contains filtered or unexported fields
}

func (*RecordLog) Close

func (rl *RecordLog) Close() error

func (*RecordLog) Read

func (rl *RecordLog) Read(p []byte) (n int, err error)

func (*RecordLog) Write

func (rl *RecordLog) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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