Documentation ¶
Overview ¶
Package docmanager helps persist documents state to disk
Index ¶
- func DeleteOldOrchestrationDirectories(log log.T, instanceID, orchestrationRootDirName string, ...)
- func DeleteSessionOrchestrationDirectories(log log.T, instanceID, orchestrationRootDirName string, ...)
- func DocumentStateDir(instanceID, locationFolder string) string
- type DocumentFileMgr
- func (d *DocumentFileMgr) GetDocumentState(fileName, locationFolder string) contracts.DocumentState
- func (d *DocumentFileMgr) MoveDocumentState(fileName, srcLocationFolder, dstLocationFolder string)
- func (d *DocumentFileMgr) PersistDocumentState(fileName, locationFolder string, state contracts.DocumentState)
- func (d *DocumentFileMgr) RemoveDocumentState(commandID, locationFolder string)
- type DocumentMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteOldOrchestrationDirectories ¶
func DeleteOldOrchestrationDirectories(log log.T, instanceID, orchestrationRootDirName string, retentionDurationHours int, associationRetentionDurationHours int)
DeleteOldOrchestrationDirectories deletes expired orchestration directories based on retentionDurationHours and associationRetentionDurationHours.
func DeleteSessionOrchestrationDirectories ¶
func DeleteSessionOrchestrationDirectories(log log.T, instanceID, orchestrationRootDirName string, retentionDurationHours int)
DeleteSessionOrchestrationDirectories deletes expired orchestration directories based on session retentionDurationHours.
func DocumentStateDir ¶
TODO rework this part DocumentStateDir returns absolute filename where command states are persisted
Types ¶
type DocumentFileMgr ¶
type DocumentFileMgr struct {
// contains filtered or unexported fields
}
TODO use class lock instead of global lock? TODO decouple the DocState model to better fit the service-processor-executer architecture DocumentFileMgr encapsulate the file access and perform bookkeeping operations at the specified file location
func NewDocumentFileMgr ¶
func NewDocumentFileMgr(context context.T, dataStorePath, rootDirName, stateLocation string) *DocumentFileMgr
func (*DocumentFileMgr) GetDocumentState ¶
func (d *DocumentFileMgr) GetDocumentState(fileName, locationFolder string) contracts.DocumentState
func (*DocumentFileMgr) MoveDocumentState ¶
func (d *DocumentFileMgr) MoveDocumentState(fileName, srcLocationFolder, dstLocationFolder string)
func (*DocumentFileMgr) PersistDocumentState ¶
func (d *DocumentFileMgr) PersistDocumentState(fileName, locationFolder string, state contracts.DocumentState)
func (*DocumentFileMgr) RemoveDocumentState ¶
func (d *DocumentFileMgr) RemoveDocumentState(commandID, locationFolder string)
RemoveData deletes the fileName from locationFolder under defaultLogDir/instanceID
type DocumentMgr ¶
type DocumentMgr interface { MoveDocumentState(fileName, srcLocationFolder, dstLocationFolder string) PersistDocumentState(fileName, locationFolder string, state contracts.DocumentState) GetDocumentState(fileName, locationFolder string) contracts.DocumentState RemoveDocumentState(fileName, locationFolder string) }