component

package
v0.0.0-...-2963f48 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigComponentIsInitialized

func ConfigComponentIsInitialized(path string) bool

ConfigComponentIsInitialized returns true if the repo is initialized at provided |path|.

func DatastoreComponentIsInitialized

func DatastoreComponentIsInitialized(path string) bool

DatastoreComponentIsInitialized returns true if the datastore dir exists.

func InitConfigComponent

func InitConfigComponent(path string, conf *config.Config) error

fsrepoConfigInit initializes the FSRepo's ConfigComponent.

func InitDatastoreComponent

func InitDatastoreComponent(path string, conf *config.Config) error

Types

type Component

type Component interface {
	Open() error
	io.Closer
	SetPath(string)
}

type ConfigComponent

type ConfigComponent struct {
	// contains filtered or unexported fields
}

ConfigComponent abstracts the config component of the FSRepo. NB: create with makeConfigComponent function. NOT THREAD-SAFE

func (*ConfigComponent) Close

func (c *ConfigComponent) Close() error

Close satisfies the fsrepoComponent interface.

func (*ConfigComponent) Config

func (c *ConfigComponent) Config() *config.Config

func (*ConfigComponent) GetConfigKey

func (c *ConfigComponent) GetConfigKey(key string) (interface{}, error)

GetConfigKey retrieves only the value of a particular key.

func (*ConfigComponent) Open

func (c *ConfigComponent) Open() error

Open returns an error if the config file is not present.

func (*ConfigComponent) SetConfig

func (c *ConfigComponent) SetConfig(updated *config.Config) error

SetConfig updates the config file.

func (*ConfigComponent) SetConfigKey

func (c *ConfigComponent) SetConfigKey(key string, value interface{}) error

SetConfigKey writes the value of a particular key.

func (*ConfigComponent) SetPath

func (c *ConfigComponent) SetPath(p string)

type DatastoreComponent

type DatastoreComponent struct {
	// contains filtered or unexported fields
}

DatastoreComponent abstracts the datastore component of the FSRepo.

func (*DatastoreComponent) Close

func (dsc *DatastoreComponent) Close() error

func (*DatastoreComponent) Datastore

func (*DatastoreComponent) Open

func (dsc *DatastoreComponent) Open() error

Open returns an error if the config file is not present.

func (*DatastoreComponent) SetPath

func (dsc *DatastoreComponent) SetPath(p string)

type InitializationChecker

type InitializationChecker func(path string) bool

type Initializer

type Initializer func(path string, conf *config.Config) error

Jump to

Keyboard shortcuts

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