docmanager

package
v0.0.0-...-a9ed6da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package docmanager helps persist documents state to disk

Index

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

func DocumentStateDir(instanceID, locationFolder string) string

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL