synclog

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Meta_Head = "SYNCLOG"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogInfo

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

func OpenLogFile

func OpenLogFile(dirPath string, metaInfo *MetaInfo, syncLog *SyncLog) (*LogInfo, error)

func (*LogInfo) Close

func (l *LogInfo) Close() error

func (*LogInfo) Write

func (l *LogInfo) Write(data []byte) error

type MetaData

type MetaData struct {
	//headSize uint8
	Version uint8
	Offset  uint32
	Head    string
}

func NewMetaData

func NewMetaData() *MetaData

func (*MetaData) FromBytes

func (m *MetaData) FromBytes(reader io.Reader) error

func (*MetaData) MetaSize

func (m *MetaData) MetaSize() int

func (*MetaData) ToBytes

func (m *MetaData) ToBytes() []byte

type MetaInfo

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

func OpenMetaFile

func OpenMetaFile(dirPath string) (*MetaInfo, error)

func (*MetaInfo) Close

func (m *MetaInfo) Close() error

func (*MetaInfo) SaveOffset

func (m *MetaInfo) SaveOffset(offset uint32)

type ReadFunc

type ReadFunc func([]byte) error

type ReadRequest

type ReadRequest struct {
	Offset   uint32
	PlayLoad []byte
}

type SyncLog

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

func NewSyncLog

func NewSyncLog(dirPath string, f ReadFunc) *SyncLog

func (*SyncLog) Close

func (l *SyncLog) Close() error

func (*SyncLog) Init

func (l *SyncLog) Init() error

func (*SyncLog) Write

func (l *SyncLog) Write(loger SyncLoger) error

Write write loger to sync log

type SyncLogKVItem

type SyncLogKVItem struct {
	Key   []byte
	Value []byte
}

func (*SyncLogKVItem) Format

func (kv *SyncLogKVItem) Format() []byte

func (*SyncLogKVItem) Parse

func (kv *SyncLogKVItem) Parse(data []byte) error

type SyncLoger

type SyncLoger interface {
	Format() []byte
	Parse([]byte) error
}

Jump to

Keyboard shortcuts

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