Documentation ¶
Overview ¶
Package docmanager helps persist documents state to disk
Index ¶
- func DeleteOldOrchestrationFolderLogs(log log.T, instanceID, orchestrationRootDirName string, ...)
- func DocumentStateDir(instanceID, locationFolder string) string
- type DocumentFileMgr
- func (d *DocumentFileMgr) GetDocumentState(log log.T, fileName, instanceID, locationFolder string) contracts.DocumentState
- func (d *DocumentFileMgr) MoveDocumentState(log log.T, fileName, instanceID, srcLocationFolder, dstLocationFolder string)
- func (d *DocumentFileMgr) PersistDocumentState(log log.T, fileName, instanceID, locationFolder string, ...)
- func (d *DocumentFileMgr) RemoveDocumentState(log log.T, commandID, instanceID, locationFolder string)
- type DocumentMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteOldOrchestrationFolderLogs ¶
func DeleteOldOrchestrationFolderLogs(log log.T, instanceID, orchestrationRootDirName string, retentionDurationHours int, isIntendedFileNameFormat validString)
DeleteOldOrchestrationFolderLogs deletes the logs from document/state/completed and document/orchestration folders older than retention duration which satisfy the file name format
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(dataStorePath, rootDirName, stateLocation string) *DocumentFileMgr
func (*DocumentFileMgr) GetDocumentState ¶
func (d *DocumentFileMgr) GetDocumentState(log log.T, fileName, instanceID, locationFolder string) contracts.DocumentState
func (*DocumentFileMgr) MoveDocumentState ¶
func (d *DocumentFileMgr) MoveDocumentState(log log.T, fileName, instanceID, srcLocationFolder, dstLocationFolder string)
func (*DocumentFileMgr) PersistDocumentState ¶
func (d *DocumentFileMgr) PersistDocumentState(log log.T, fileName, instanceID, locationFolder string, state contracts.DocumentState)
func (*DocumentFileMgr) RemoveDocumentState ¶
func (d *DocumentFileMgr) RemoveDocumentState(log log.T, commandID, instanceID, locationFolder string)
RemoveData deletes the fileName from locationFolder under defaultLogDir/instanceID
type DocumentMgr ¶
type DocumentMgr interface { MoveDocumentState(log log.T, fileName, instanceID, srcLocationFolder, dstLocationFolder string) PersistDocumentState(log log.T, fileName, instanceID, locationFolder string, state contracts.DocumentState) GetDocumentState(log log.T, fileName, instanceID, locationFolder string) contracts.DocumentState RemoveDocumentState(log log.T, fileName, instanceID, locationFolder string) }