Documentation ¶
Overview ¶
Package statemanager helps persist documents state to disk
Index ¶
- func DocumentStateDir(instanceID, locationFolder string) string
- func GetDocumentInfo(log log.T, fileName, instanceID, locationFolder string) model.DocumentInfo
- func GetDocumentInterimState(log log.T, fileName, instanceID, locationFolder string) model.DocumentState
- func GetPluginState(log log.T, pluginID, commandID, instanceID, locationFolder string) *model.PluginState
- func IsDocumentCurrentlyExecuting(fileName, instanceID string) bool
- func MoveDocumentState(log log.T, fileName, instanceID, srcLocationFolder, dstLocationFolder string)
- func PersistData(log log.T, fileName, instanceID, locationFolder string, object interface{})
- func PersistDocumentInfo(log log.T, docInfo model.DocumentInfo, ...)
- func PersistPluginState(log log.T, pluginState model.PluginState, ...)
- func RemoveData(log log.T, commandID, instanceID, locationFolder string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocumentStateDir ¶
DocumentStateDir returns absolute filename where command states are persisted
func GetDocumentInfo ¶
func GetDocumentInfo(log log.T, fileName, instanceID, locationFolder string) model.DocumentInfo
GetDocumentInfo returns the document info for the specified fileName
func GetDocumentInterimState ¶
func GetDocumentInterimState(log log.T, fileName, instanceID, locationFolder string) model.DocumentState
GetDocumentInterimState returns CommandState object after reading file <fileName> from locationFolder under defaultLogDir/instanceID
func GetPluginState ¶
func GetPluginState(log log.T, pluginID, commandID, instanceID, locationFolder string) *model.PluginState
GetPluginState returns PluginState after reading fileName from given locationFolder under defaultLogDir/instanceID
func IsDocumentCurrentlyExecuting ¶
IsDocumentCurrentlyExecuting checks if document already present in Pending or Current folder
func MoveDocumentState ¶
func MoveDocumentState(log log.T, fileName, instanceID, srcLocationFolder, dstLocationFolder string)
MoveDocumentState moves the document file to target location
func PersistData ¶
PersistData stores the given object in the file-system in pretty Json indented format This will override the contents of an already existing file
func PersistDocumentInfo ¶
func PersistDocumentInfo(log log.T, docInfo model.DocumentInfo, fileName, instanceID, locationFolder string)
PersistDocumentInfo stores the given PluginState in file-system in pretty Json indented format This will override the contents of an already existing file
func PersistPluginState ¶
func PersistPluginState(log log.T, pluginState model.PluginState, pluginID, commandID, instanceID, locationFolder string)
PersistPluginState stores the given PluginState in file-system in pretty Json indented format This will override the contents of an already existing file
func RemoveData ¶
RemoveData deletes the fileName from locationFolder under defaultLogDir/instanceID
Types ¶
This section is empty.