storage

package
v3.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2015 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const FILE_MODE = 0666

Variables

View Source
var (
	IsEncodeCalled bool
	IsLoadCalled   bool
	IsWriteCalled  bool
	ThrowError     bool
)

Functions

This section is empty.

Types

type BoxedInt64

type BoxedInt64 struct{ V int64 }

type FakeFileStorage

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

func (*FakeFileStorage) Encode

func (s *FakeFileStorage) Encode(data interface{}) ([]byte, error)

func (*FakeFileStorage) Load

func (f *FakeFileStorage) Load(data interface{}) error

func (*FakeFileStorage) Write

func (f *FakeFileStorage) Write(buf []byte) error

type FileStorage

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

func (*FileStorage) Encode

func (s *FileStorage) Encode(data interface{}) ([]byte, error)

func (*FileStorage) Load

func (s *FileStorage) Load(e interface{}) error

func (*FileStorage) Write

func (s *FileStorage) Write(buf []byte) error

type Storage

type Storage interface {
	Encode(data interface{}) ([]byte, error)
	Load(data interface{}) error
	Write(buf []byte) error
}

exposing these for testing

func NewFakeFileStorage

func NewFakeFileStorage(path string) Storage

func NewFileStorage

func NewFileStorage(path string) Storage

type TailNode

type TailNode map[string]*BoxedInt64

type Tailer

type Tailer struct {
	Instances map[string]TailNode
}

type Tracker

type Tracker interface {
	Update(instKey string, childKey string, childVal int64)
	LoadTailers()
	Remove(key string)
	RegisterInstance(instKey string)
	InitializeChildNode(instKey string, childkey string, offSet int64)
	Commit() error
	StartSubmissionTimer(persistInterval time.Duration)
	IsInstanceRegistered(instKey string) bool
	IsChildNodeInitialized(instKey string, childkey string) bool
	GetFileCachedOffset(instkey string, fname string) int64

	CleanUp(validIds map[string]bool)
	// contains filtered or unexported methods
}

func NewTracker

func NewTracker(s Storage, debug bool) Tracker

Jump to

Keyboard shortcuts

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