Categorygithub.com/domonda/go-docdb
modulepackage
0.0.0-20241023064030-f3e791848ffc
Repository: https://github.com/domonda/go-docdb.git
Documentation: pkg.go.dev

# README

go-docdb

Experimental, do not use!

Copyright (c) 2021 by DOMONDA GmbH

# Packages

No description provided by the author

# Functions

AddDocumentVersion adds a new version to a document using the files returned by createVersion.
CancelCheckOutDocument cancels a potential checkout.
No description provided by the author
CheckedOutDocumentDir returns a fs.File for the directory where a document would be checked out.
CheckedOutDocumentFileProvider returns a FileProvider for the directory where a document would be checked out.
CheckedOutDocuments returns the CheckOutStatus of all checked out documents.
CheckInDocument checks in a checked out document and returns the VersionInfo for the newly created version.
CheckOutDocument checks out a document for a user with a stated reason.
CheckOutNewDocument creates a new document for a company in checked out state.
Configure the database connection.
ContentHash returns a Dropbox compatible 64 hex character content hash by reading from an io.Reader until io.EOF.
ContextWithVersionTime returns a new context with the passed version time added to it.
CopyAllCompanyDocumentFiles copies the files of all versions of all documents of a company to a backup directory.
CopyDocumentFiles copies the files of all versions of a document to a backup directory.
No description provided by the author
DeleteDocument deletes all versions of a document including its workspace directory if checked out.
DeleteDocumentVersion deletes a version of a document that must not be checked out and returns the left over versions.
DirFileProvider returns a FileProvider for a fs.File directory.
DocumentCheckOutStatus returns the CheckOutStatus of a document.
DocumentCompanyID returns the companyID for a docID.
DocumentExists returns true if a document with the passed docID exists.
DocumentFileExists returns if a document file with filename exists in the latest document version.
DocumentFileReader returns a fs.FileReader for a file of the latest document version.
DocumentVersionFileProvider returns a FileProvider for the files of a document version.
DocumentVersionFileReader returns a fs.FileReader for a file of a document version.
DocumentVersionInfo returns the VersionInfo for a VersionTime.
DocumentVersions returns all version timestamps of a document in ascending order.
EnumCompanyDocumentIDs calls the passed callback with the ID of every document of a company in the database.
EnumDocumentIDs calls the passed callback with the ID of every document in the database.
ExtFileProvider returns a FileProvider that extends a base FileProvider with additional files that will be returned before the files of the base FileProvider.
No description provided by the author
GetConn returns the configured database connection.
No description provided by the author
No description provided by the author
LatestDocumentVersion returns the lates VersionTime of a document.
No description provided by the author
LatestDocumentVersionInfo returns the VersionInfo for the latest document version.
MustVersionTimeFromString parses a string as VersionTime.
NewConnWithError returns a Conn where all methods return the passed error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewVersionInfo uses the files from versionDir.
NewVersionTime returns the timestamp for a new version.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PostgresInsertDocumentVersionIfMissing inserts the document information if there is no existing one.
No description provided by the author
ReadDocumentFile reads a file of the latest document version.
ReadDocumentVersionFile returns the contents of a file of a document version.
ReadFileInfo reads the file content from file and returns a FileInfo with the file name, size and hash.
No description provided by the author
No description provided by the author
No description provided by the author
RemoveFileProvider returns a FileProvider that wraps a base FileProvider and does not return files with the passed removeFilenames.
SetDocumentCompanyID changes the companyID for a document.
SubstituteDeletedDocumentVersion will substitue the passed version with the next existing version it does not exist anymore.
TempFileCopy reads a file from a FileProvider and writes it to a temporary file with a random basename and the same extension as the original filename.
No description provided by the author
VersionTimeFrom returns a VersionTime for the given time translated to UTC and truncated to milliseconds.
VersionTimeFromString parses a string as VersionTime.

# Constants

ErrNoChanges is returned when a new document version has no changes compared to the previous version.
VersionTimeFormat is the string format of a version time returned by VersionTime.String() and parsed by VersionTimeFromString.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VersionTime of a document.

# Interfaces

Conn is an interface for a docdb connection.
FileProvider is an interface for read access to named files.

# Type aliases

No description provided by the author
No description provided by the author