Documentation ¶
Index ¶
- Variables
- func ApplyMigrations(oplog *OpLog) error
- type OpLog
- func (o *OpLog) Add(ops ...*v1.Operation) error
- func (o *OpLog) Delete(opID ...int64) error
- func (o *OpLog) Get(opID int64) (*v1.Operation, error)
- func (o *OpLog) Query(q Query, f func(*v1.Operation) error) error
- func (o *OpLog) Subscribe(q Query, f *Subscription)
- func (o *OpLog) Transform(q Query, f func(*v1.Operation) (*v1.Operation, error)) error
- func (o *OpLog) Unsubscribe(f *Subscription) error
- func (o *OpLog) Update(ops ...*v1.Operation) error
- type OpStore
- type OperationEvent
- type Query
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStopIteration = errors.New("stop iteration") ErrNotExist = errors.New("operation does not exist") ErrExist = errors.New("operation already exists") NullOPID = int64(0) )
View Source
var CurrentVersion = int64(len(migrations))
View Source
var SelectAll = Query{}
Functions ¶
func ApplyMigrations ¶ added in v1.0.0
Types ¶
type OpLog ¶
type OpLog struct {
// contains filtered or unexported fields
}
func (*OpLog) Subscribe ¶
func (o *OpLog) Subscribe(q Query, f *Subscription)
func (*OpLog) Unsubscribe ¶
func (o *OpLog) Unsubscribe(f *Subscription) error
type OpStore ¶ added in v1.5.0
type OpStore interface { Query(q Query, f func(*v1.Operation) error) error Get(opID int64) (*v1.Operation, error) Add(op ...*v1.Operation) error Update(op ...*v1.Operation) error // returns the previous values of the updated operations OR an error Delete(opID ...int64) ([]*v1.Operation, error) // returns the deleted operations OR an error Transform(q Query, f func(*v1.Operation) (*v1.Operation, error)) error Version() (int64, error) SetVersion(version int64) error }
type OperationEvent ¶ added in v1.5.0
type OperationEvent int
const ( OPERATION_ADDED OperationEvent = iota OPERATION_UPDATED OPERATION_DELETED )
type Query ¶ added in v1.0.0
type Subscription ¶ added in v1.5.0
type Subscription = func(ops []*v1.Operation, event OperationEvent)
Click to show internal directories.
Click to hide internal directories.