repli

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubjectCurrentFileIds string = "current_fileids"
	SubjectCurrentIndex   string = "current_index"
	SubjectFetchSize      string = "fetch_size"
	SubjectFetchData      string = "fetch_data"
	SubjectRepli          string = "repli"
)

Variables

This section is empty.

Functions

func NewNoopEmitter

func NewNoopEmitter() *noopEmitter

func NewNoopReciver

func NewNoopReciver() *noopReciver

func NewStreamEmitter

func NewStreamEmitter(ctx runtime.Context, logger *log.Logger, tempDir string, maxPayload int32) *streamEmitter

func NewStreamReciver

func NewStreamReciver(ctx runtime.Context, logger *log.Logger, tempDir string, rto time.Duration) *streamReciver

Types

type Destination

type Destination interface {
	LastFiles() []FileIDAndIndex
	Insert(fileID int32, index int64, checksum uint32, key []byte, r io.Reader, expiry time.Time) error
	Delete(key []byte) error
}

type Emitter

type Emitter interface {
	Start(src Source, bindIP string, bindPort int) error
	Stop() error
	EmitInsert(filer indexer.Filer) error
	EmitDelete(key []byte) error
}

type FileIDAndIndex

type FileIDAndIndex struct {
	FileID int32
	Index  int64
}

type PartialData

type PartialData struct {
	Data []byte
	Err  string
}

type Reciver

type Reciver interface {
	Start(dst Destination, serverIP string, serverPort int) error
	Stop() error
}

type RepliData

type RepliData struct {
	IsDelete    bool
	FileID      int32
	Index       int64
	Size        int64
	Checksum    uint32
	EntryKey    []byte
	EntryValue  []byte
	EntryExpiry time.Time
	PartKeys    []string
}

type RequestCurrentFileIds

type RequestCurrentFileIds struct {
}

type RequestCurrentIndex

type RequestCurrentIndex struct {
	FileID int32
}

type RequestFetchData

type RequestFetchData struct {
	FileID int32
	Index  int64
	Size   int64
}

type RequestFetchSize

type RequestFetchSize struct {
	FileID int32
	Index  int64
}

type ResponseCurrentFileIds

type ResponseCurrentFileIds struct {
	FileIds []int32
	Err     string
}

type ResponseCurrentIndex

type ResponseCurrentIndex struct {
	Index int64
	Err   string
}

type ResponseFetchData

type ResponseFetchData struct {
	Checksum    uint32
	PartKeys    []string
	EntryKey    []byte
	EntryValue  []byte
	EntryExpiry time.Time
	Err         string
}

type ResponseFetchSize

type ResponseFetchSize struct {
	Size int64
	EOF  bool
	Err  string
}

type Source

type Source interface {
	FileIds() []int32
	LastIndex(fileID int32) int64
	Header(fileID int32, index int64) (*datafile.Header, bool, error)
	Read(fileID int32, index int64, size int64) (*datafile.Entry, error)
}

Jump to

Keyboard shortcuts

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