diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..56e272a --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2017 Vincent Batts, Raleigh, NC, USA + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..0b9c558 --- /dev/null +++ b/doc.go @@ -0,0 +1,7 @@ +// copyright (C) 2017 Vincent Batts. All rights reserved. Usage of this code +// is governed by the license found in the LICENSE file. + +// Package storage is intended to the common interaction model for an untold +// number of backing graph or storage drivers, namely for application container +// image storage. +package storage diff --git a/driver/driver.go b/driver/driver.go new file mode 100644 index 0000000..1eab1f4 --- /dev/null +++ b/driver/driver.go @@ -0,0 +1,6 @@ +package driver + +// Driver is the vfs level driver to operate on filesystem trees (i.e. +// copy-on-write filesystems, etc) +type Driver struct { +} diff --git a/register.go b/register.go new file mode 100644 index 0000000..7b8471d --- /dev/null +++ b/register.go @@ -0,0 +1,27 @@ +package storage + +import "git.thisco.de/vbatts/image-storage-interfaces/driver" + +// Drivers returns a sorted list of the registered drivers +func Drivers() []string { + return nil +} + +// Register makes a database driver available by the provided name. If Register +// is called twice with the same name or if driver is nil, it panics. +func Register(name string, driver driver.Driver) { +} + +// OpenHandle a storage handle using the specified storage driver name and a +// rootPath for that driver to operate in. +func OpenHandle(name string, rootPath string) (*S, error) { + return nil, nil +} + +// S is a storage handle for the storage and management of filesystem trees. +// +// Operations on an handle instance are intended to be safe for concurrent use. +// Though this would likely not be safe for two competing instances to be +// operating on the same rootPath (more thought needed here). +type S struct { +}