// NewDiskPersistence creates a diskPersistence that stores data under the given filesystem
// directory.
NewDiskPersistence creates a diskPersistence that stores data under the given filesystem
directory.
// NewDiskPersistence creates a diskPersistence that stores data under the given filesystem // directory .
func NewDiskPersistence(directory string) (Persistence, error) {
	if err := os.MkdirAll(directory, directoryMode); err != nil {
		return nil, errors.New("persistence: could not create directory: " + directory + ": " + err.Error())
	}
	return &diskPersistence{directory: directory, memory: newMemoryPersistence()}, nil
}
func NewDiskPersistence ( directory string ) ( Persistence , error ) { if err := os . MkdirAll ( directory , directoryMode ) ; err != nil { return nil , errors . New ( " " + directory + " " + err . Error ( ) ) } return & diskPersistence { directory : directory , memory : newMemoryPersistence ( ) } , nil }
NewDiskPersistence creates a diskPersistence that stores data under the given filesystem
directory.
NewDiskPersistence creates a diskPersistence that stores data under the given filesystem directory .