dab

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 5 Imported by: 0

Documentation

Overview

Package dab -- short for Data Access Broker -- contains functions that help save and load data, mostly to a local filesystem (but sometimes to a blind content-addressed objectstore, as well).

Most dab functions return objects from the wfapi package. Some return a dab type, in which case that object is to help manage further access -- but eventually you should still reach wfapi data types.

Functions that deal with the filesystem may expect to be dealing with either a workspace filesystem (e.g., commingled with other user files), or a catalog filesystem projection (a somewhat stricter situation). Sometimes these are the same. The function name should provide a hint about which situations it handles.

Sometimes, search features are provided for workspace filesystems, since there is no other index of those contents aside from the filesystem itself.

Most of these functions return the "latest" version of their relevant API type. At the moment, that's not saying much, because we haven't grown in such a way that we support major varations of API object reversions -- but in the future, this means these functions may do "migrational" transforms to the data on the fly.

Index

Constants

View Source
const (
	MagicFilename_Module = "module.wf"
	MagicFilename_Plot   = "plot.wf"
)
View Source
const (
	MagicFilename_Workspace = ".warpforge"
)

Variables

This section is empty.

Functions

func ModuleFromFile

func ModuleFromFile(fsys fs.FS, filename string) (wfapi.Module, error)

ModuleFromFile loads a wfapi.Module from filesystem path.

In typical usage, the filename parameter will have the suffix of MagicFilename_Module.

Errors:

  • warpforge-error-io -- for errors reading from fsys.
  • warpforge-error-serialization -- for errors from try to parse the data as a Module.
  • warpforge-error-datatoonew -- if encountering unknown data from a newer version of warpforge!

func PlotFromFile

func PlotFromFile(fsys fs.FS, filename string) (wfapi.Plot, error)

PlotFromFile loads a wfapi.Plot from filesystem path.

In typical usage, the filename parameter will have the suffix of MagicFilename_Plot.

Errors:

  • warpforge-error-io -- for errors reading from fsys.
  • warpforge-error-serialization -- for errors from try to parse the data as a Plot.
  • warpforge-error-datatoonew -- if encountering unknown data from a newer version of warpforge!

Types

This section is empty.

Jump to

Keyboard shortcuts

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