Class FolderDocumentStoreOptions
- Namespace
- IntentSharp.Documents
- Assembly
- IntentSharp.dll
Settings for FolderDocumentStore. These belong to the store a developer chooses, so they are set in code; a document never configures the store that holds it. The store copies them when it is created, so a change made afterwards does not reach it.
public sealed class FolderDocumentStoreOptions
- Inheritance
-
objectFolderDocumentStoreOptions
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Constructors
- FolderDocumentStoreOptions()
Creates options that keep the history in
.intentsharpinside the working folder, scan subfolders, watch for edits with 250 ms of quiet, keep 100 versions per document, wait up to 10 seconds for the lock file and take documents of up to 4 MB.
Properties
- Clock
The clock that stamps versions and state values. Null, the default, uses System.
- DebounceInterval
How long the working folder must be quiet after an edit before the store reads it again. Default 250 ms; at most one minute.
- Include
Which files of the working folder are documents, by their id. Null, the default, takes every file. Whatever this says, the store never reads the state folder, files and folders whose name starts with a dot (on every platform, so a
.gitignoreor a.githubfolder is never a document), hidden or system files and folders, its own temporary files, folders reached through a link (a symbolic link or a junction), or a file link whose target lies outside the working folder or in the state folder (reported in Problems). A document saved through the store's API is stored whether or not it passes; this only selects the working copies the store reads. The filter runs wherever the store looks for files, including when it notices a change: an exception it throws for a file is logged once and reported in Problems for that file, which the store then does not read, and the other files are read as usual.
- IncludeSubdirectories
Read documents from subfolders of the working folder too. Default true.
- LockTimeout
How long a save, an activation or a state write waits for the lock file another store instance holds before it throws IOException. Default 10 seconds; more than zero.
- MaxDocumentBytes
The largest document the store takes, in bytes. A working copy larger than this is not read: it is reported in Problems with its size, any running version stays in effect, and nothing of it reaches the history. A save of a larger text throws ArgumentException, and the client's edit seam refuses a larger edit to this store before any validator reads it (see MaxEditBytes); behind a store of your own that wraps this one, the seam refuses it when the save is refused. A file's size is its length on disk; a text's is its length in UTF-8, the encoding the store writes. Default 4 MB (4,194,304 bytes); at least 1. Raise it in code for larger documents; a document never changes it.
- MaxVersionsPerDocument
How many versions of one document the store keeps. After a save, the oldest versions beyond this number are removed, except the running version, the last good version (the most recently running version that is not running now and not rejected) and candidates (versions saved without running that are newer than the running version), so a document can keep more when those alone exceed it. Default 100; at least 2.
- ReadOnly
True keeps every version and state value in memory only, for the life of the process: the working copies are read as the running versions, saves and activations still work but no history, state file or working copy is written, and history and comparison across restarts are off. The store also switches to this mode by itself, and logs it once, when it cannot write its state folder. Default false.
- StateRoot
The folder that holds the history, the state file and the lock file. Null, the default, uses
.intentsharpinside the working folder; a relative path resolves against the working folder. Set it to a writable folder apart from the working folder when that one is read-only (baked into a container image, deployed from a zip, or mounted from a configuration map): nothing is then written under the working folder except the rewrite of a working copy when a version is activated, and that only where the working folder accepts it. Where it does not, the version still runs, served from the history, and the store reports the working copy (and tries the rewrite again whenever it reads the folder) until it shows the running version; the old text is not taken for an edit.
- Validators
Validators the store runs on an external edit of a working copy, beside those of every client built with the store. A store used without a client applies only these. A validator may read the store during an assessment but not write to it: a write or scan it starts on that store throws InvalidOperationException, and the edit is rejected. Empty by default.
- WatchForChanges
Watch the working folder and read it again when a file is created, changed, renamed or deleted. Default true.