Documentation ¶
Index ¶
- type Config
- type GetDocumentResult
- type Manager
- func (m *Manager) GetDocument(ctx context.Context, docId string) (*GetDocumentResult, error)
- func (m *Manager) StoreDocument(ctx context.Context, docID string, r io.Reader) (*StoreDocumentResult, error)
- func (m *Manager) UpdateDocument(ctx context.Context, docID string, key string, value []byte) (*GetDocumentResult, error)
- func (m *Manager) VerifyDocument(ctx context.Context, docID, globalHash string) (bool, error)
- type ObjectManifest
- type StoreDocumentResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NumberWorkers int ClientOptions *immuclient.Options }
Config represents the required API options.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig defines a configuration with stock options.
func (*Config) WithClientOptions ¶
func (c *Config) WithClientOptions(options *immuclient.Options) *Config
WithClientOptions set the client options used to initialize the ImmuDB client.
func (*Config) WithNumberWorkers ¶
WithNumberWorkers set the number of workers used on Store actions.
type GetDocumentResult ¶
GetDocumentResult represents the result of fetching a document.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager represents the object required to use the API.
func (*Manager) GetDocument ¶
GetDocument allows the extraction of a document provided its global ID.
func (*Manager) StoreDocument ¶
func (m *Manager) StoreDocument(ctx context.Context, docID string, r io.Reader) (*StoreDocumentResult, error)
StoreDocument saves a JSON document in the database, marshaling its structure into key-value properties, representing the transversal property paths of the original object.
func (*Manager) UpdateDocument ¶
func (m *Manager) UpdateDocument(ctx context.Context, docID string, key string, value []byte) (*GetDocumentResult, error)
UpdateDocument allows the update of a given property of a document. Here the underlying assumption for the implementation is that updates are fairly rare and limited in scope.
type ObjectManifest ¶
type ObjectManifest struct { ObjectID string `json:"id"` Indexes []uint64 `json:"indexes"` Hash string `json:"hash"` }
ObjectManifest defines the top level object that describes a document in the Database, including the object ID of said document, the indexes of each of its properties and the global hash of the document (comprised by the hash of hashes, sorted according to the associated property index).
type StoreDocumentResult ¶
StoreDocumentResult represents the insertion result of a document.