util

package
v0.11.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTempPath

func GenerateTempPath() string

GenerateTempPath returns a string path representing the location where it is okay to store temporary data. No structure or created or deleted as part of this operation.

func NewCustomSchemaManager

func NewCustomSchemaManager(ctx SchemaContext) (*openbazaarSchemaManager, error)

NewCustomSchemaManger allows a custom SchemaContext to be provided to change

func NewSchemaManager

func NewSchemaManager() (*openbazaarSchemaManager, error)

NewSchemaManager returns a service that handles the data storage directory required during runtime. This service also ensures no errors can be produced at runtime after initial creation. An error may be produced if the SchemaManager is unable to verify the availability of the data storage directory.

func OpenbazaarPathTransform

func OpenbazaarPathTransform(basePath string, testModeEnabled bool) (path string, err error)

DefaultPathTransform accepts a string path representing the location where application data can be stored and returns a string representing the location where OpenBazaar prefers to store its schema on the filesystem relative to that path. If the path cannot be transformed, an error will be returned

Types

type SchemaContext

type SchemaContext struct {
	DataPath        string
	TestModeEnabled bool
	OS              string
}

SchemaContext are the parameters which the SchemaManager derive its source of truth. When their zero values are provided, a reasonable default will be assumed during runtime.

Jump to

Keyboard shortcuts

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