Documentation ¶
Overview ¶
Package filesystem is a storage backend base on filesystems
Index ¶
- type ConfigFile
- type ConfigStorage
- type ObjectStorage
- func (o *ObjectStorage) Begin() core.TxObjectStorage
- func (s *ObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Object, error)
- func (s *ObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error)
- func (s *ObjectStorage) NewObject() core.Object
- func (s *ObjectStorage) Set(core.Object) (core.Hash, error)
- func (s *ObjectStorage) Writer() (io.WriteCloser, error)
- type ReferenceStorage
- type Storage
- type TxObjectStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFile ¶
type ConfigFile struct {
Remotes map[string]*config.RemoteConfig `gcfg:"remote"`
}
type ConfigStorage ¶
type ConfigStorage struct {
// contains filtered or unexported fields
}
func (*ConfigStorage) DeleteRemote ¶
func (c *ConfigStorage) DeleteRemote(name string) error
func (*ConfigStorage) Remote ¶
func (c *ConfigStorage) Remote(name string) (*config.RemoteConfig, error)
func (*ConfigStorage) Remotes ¶
func (c *ConfigStorage) Remotes() ([]*config.RemoteConfig, error)
func (*ConfigStorage) SetRemote ¶
func (c *ConfigStorage) SetRemote(r *config.RemoteConfig) error
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
ObjectStorage is an implementation of core.ObjectStorage that stores data on disk in the standard git format (this is, the .git directory).
Zero values of this type are not safe to use, see the New function below.
Currently only reads are supported, no writting.
Also values from this type are not yet able to track changes on disk, this is, Gitdir values will get outdated as soon as repositories change on disk.
func (*ObjectStorage) Begin ¶
func (o *ObjectStorage) Begin() core.TxObjectStorage
func (*ObjectStorage) Get ¶
func (s *ObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Object, error)
Get returns the object with the given hash, by searching for it in the packfile and the git object directories.
func (*ObjectStorage) Iter ¶
func (s *ObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error)
Iter returns an iterator for all the objects in the packfile with the given type.
func (*ObjectStorage) NewObject ¶
func (s *ObjectStorage) NewObject() core.Object
func (*ObjectStorage) Set ¶
Set adds a new object to the storage. As this functionality is not yet supported, this method always returns a "not implemented yet" error an zero hash.
func (*ObjectStorage) Writer ¶
func (s *ObjectStorage) Writer() (io.WriteCloser, error)
Writer method not supported on Memory storage
type ReferenceStorage ¶
type ReferenceStorage struct {
// contains filtered or unexported fields
}
func (*ReferenceStorage) Get ¶
func (r *ReferenceStorage) Get(n core.ReferenceName) (*core.Reference, error)
func (*ReferenceStorage) Iter ¶
func (r *ReferenceStorage) Iter() (core.ReferenceIter, error)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(fs fs.Filesystem) (*Storage, error)
func (*Storage) ConfigStorage ¶
func (s *Storage) ConfigStorage() config.ConfigStorage
func (*Storage) ObjectStorage ¶
func (s *Storage) ObjectStorage() core.ObjectStorage
func (*Storage) ReferenceStorage ¶
func (s *Storage) ReferenceStorage() core.ReferenceStorage
type TxObjectStorage ¶
type TxObjectStorage struct{}
func (*TxObjectStorage) Commit ¶
func (tx *TxObjectStorage) Commit() error
func (*TxObjectStorage) Get ¶
func (tx *TxObjectStorage) Get(core.ObjectType, core.Hash) (core.Object, error)
func (*TxObjectStorage) Rollback ¶
func (tx *TxObjectStorage) Rollback() error