Documentation ¶
Overview ¶
Package local implements repository storage in a local directory.
Index ¶
- Variables
- type Local
- func (b *Local) Close() error
- func (b *Local) Create() (backend.Blob, error)
- func (b *Local) Delete() error
- func (b *Local) Get(t backend.Type, name string) (io.ReadCloser, error)
- func (b *Local) GetReader(t backend.Type, name string, offset, length uint) (io.ReadCloser, error)
- func (b *Local) List(t backend.Type, done <-chan struct{}) <-chan string
- func (b *Local) Location() string
- func (b *Local) Remove(t backend.Type, name string) error
- func (b *Local) Test(t backend.Type, name string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrWrongData = errors.New("wrong data returned by backend, checksum does not match")
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func Create ¶
Create creates all the necessary files and directories for a new local backend at dir. Afterwards a new config blob should be created.
func (*Local) Close ¶
Close closes all open files. They may have been closed already, so we ignore all errors.
func (*Local) Create ¶
Create creates a new Blob. The data is available only after Finalize() has been called on the returned Blob.
func (*Local) Get ¶
Get returns a reader that yields the content stored under the given name. The reader should be closed after draining it.
func (*Local) GetReader ¶
GetReader returns an io.ReadCloser for the Blob with the given name of type t at offset and length. If length is 0, the reader reads until EOF.
func (*Local) List ¶
List returns a channel that yields all names of blobs of type t. A goroutine is started for this. If the channel done is closed, sending stops.