Documentation ¶
Overview ¶
Package checkpoint persists event log state information so that event log consumer can resume from the last read event in the case of a restart or unexpected interruption.
Index ¶
Constants ¶
View Source
const ( SchemeKafka = "kafka" SchemeBinlog = "myslave" )
All valid State scheme.
Variables ¶
View Source
var (
ErrStateNotFound = errors.New("state info not found")
)
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint interface { // Shutdown stops the checkpoint and flush all inflight states to be persisted. Shutdown() error // Commit queues the given event state information to be persisted. Commit(state State) error // LastPersistedState returns the last committed and persisted state. LastPersistedState(state State) error }
type Manager ¶
type Manager interface { // AllStates dumps all event state information. AllStates() ([]State, error) }
Manager is an interface that manages checkpoint.
type State ¶
type State interface { // Marshal serialize the state data. Marshal() []byte // Unmarshal unserialize the state from byte array data. Unmarshal([]byte) // String returns the string form of the state position. String() string // DSN returns the data source of the state. DSN() string // Scheme returns the type of statte. Scheme() string // Name returns name of the state. Name() string // Delta returns difference of two state. Delta(that State) string }
State is an interface for all event state information.
Click to show internal directories.
Click to hide internal directories.