Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterStateStorage ¶
func RegisterStateStorage( name config.StateStorageType, storageProvider StorageProvider, ) bool
RegisterStateStorage registers a config.StateStorageType to a Provider implementation which creates the Storage when requested
Types ¶
type Manager ¶ added in v0.4.0
type Manager interface {
Start() error
Stop() error
Get() (map[string]*Offset, error)
Set(
key string, value *Offset,
) error
StateEncoder(
name string, encoder encoding.BinaryMarshaler,
) error
StateDecoder(
name string, decoder encoding.BinaryUnmarshaler,
) (present bool, err error)
SetEncodedState(
name string, encodedState []byte,
)
EncodedState(
name string,
) (encodedState []byte, present bool)
SnapshotContext() (*watermark.SnapshotContext, error)
SnapshotContextTransaction(
snapshotName string, createIfNotExists bool, transaction func(snapshotContext *watermark.SnapshotContext) error,
) error
}
func NewStateStorageManager ¶ added in v0.4.0
type Offset ¶
type Offset struct {
Timestamp time.Time `json:"timestamp"`
Snapshot bool `json:"snapshot"`
SnapshotDone bool `json:"snapshot_done"`
SnapshotName *string `json:"snapshot_name,omitempty"`
SnapshotOffset int `json:"snapshot_offset"`
SnapshotKeyset []byte `json:"snapshot_keyset"`
LSN pgtypes.LSN `json:"lsn"`
}
func (*Offset) MarshalBinary ¶
func (*Offset) UnmarshalBinary ¶
type StateEncoderFunc ¶
func (StateEncoderFunc) MarshalBinary ¶
func (sef StateEncoderFunc) MarshalBinary() (data []byte, err error)
type Storage ¶
type Storage interface {
Start() error
Stop() error
Save() error
Load() error
Get() (map[string]*Offset, error)
Set(
key string, value *Offset,
) error
StateEncoder(
name string, encoder encoding.BinaryMarshaler,
) error
StateDecoder(
name string, decoder encoding.BinaryUnmarshaler,
) (present bool, err error)
EncodedState(
name string,
) (encodedState []byte, present bool)
SetEncodedState(
name string, encodedState []byte,
)
}
func NewDummyStateStorage ¶ added in v0.3.1
func NewDummyStateStorage() Storage
func NewFileStateStorage ¶ added in v0.3.1
func NewStateStorage ¶
NewStateStorage instantiates a new instance of the requested Storage when available, otherwise returns an error.
Click to show internal directories.
Click to hide internal directories.