docmanager

package
v0.0.0-...-f6ab670 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 13

Documentation

Overview

Package docmanager helps persist documents state to disk

Index

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

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

Jump to

Keyboard shortcuts

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