component

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDataStoreDirectory = "datastore"
)

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(dspath string) bool

DatastoreComponentIsInitialized returns true if the datastore dir exists.

func EventlogComponentIsInitialized

func EventlogComponentIsInitialized(path string) bool

func InitConfigComponent

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

fsrepoConfigInit initializes the FSRepo's ConfigComponent.

func InitDatastoreComponent

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

func InitEventlogComponent

func InitEventlogComponent(repoPath string, conf *config.Config) error

Types

type Component

type Component interface {
	Open(*config.Config) 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(_ *config.Config) error

Open returns an error if the config file is not present. This component is always called with a nil config parameter. Other components rely on the config, to keep the interface uniform, it is special-cased.

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(*config.Config) error

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

func (*DatastoreComponent) SetPath

func (dsc *DatastoreComponent) SetPath(p string)

type EventlogComponent

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

func (*EventlogComponent) Close

func (c *EventlogComponent) Close() error

func (*EventlogComponent) Open

func (c *EventlogComponent) Open(config *config.Config) error

func (*EventlogComponent) SetPath

func (c *EventlogComponent) SetPath(path 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