Documentation
¶
Overview ¶
Package persist enables persistent storage of the execution state.
Index ¶
- type Persister
- func (p *Persister) Deserialize(b []byte) error
- func (p *Persister) GetMemory() cache.Memory
- func (p *Persister) GetState() *state.State
- func (p *Persister) Invalid() bool
- func (p *Persister) Load(key string) error
- func (p *Persister) Save(key string) error
- func (p *Persister) Serialize() ([]byte, error)
- func (p *Persister) WithContent(st *state.State, ca *cache.Cache) *Persister
- func (p *Persister) WithContext(ctx context.Context) *Persister
- func (p *Persister) WithSession(sessionId string) *Persister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persister ¶
type Persister struct { State *state.State Memory *cache.Cache // contains filtered or unexported fields }
Persister abstracts storage and retrieval of state and cache.
func NewPersister ¶
NewPersister creates a new Persister instance.
func (*Persister) Deserialize ¶
Deserialize decodes the state and cache from storage, and applies them to the persister.
func (*Persister) GetMemory ¶
GetMemory returns the cache (memory) enclosed by the Persister.
func (*Persister) GetState ¶
GetState returns the state enclosed by the Persister.
func (*Persister) Invalid ¶
Invalid checks if the underlying state has been invalidated.
An invalid state will cause Save to panic.
func (*Persister) Load ¶
Load retrieves state and cache from the db.Db backend.
func (*Persister) Save ¶
Save perists the state and cache to the db.Db backend.
func (*Persister) Serialize ¶
Serialize encodes the state and cache into byte form for storage.
func (*Persister) WithContent ¶
WithContent sets a current State and Cache object.
This method is normally called before Serialize / Save.
func (*Persister) WithContext ¶
WithSession is a chainable function that sets the current golang context of the persister.
Source Files
¶
- doc.go
- log.go
- persist.go