Documentation ¶
Overview ¶
Package filesystem is a storage backend base on filesystems
Index ¶
- type ConfigStorage
- type ObjectStorage
- func (o *ObjectStorage) Begin() core.TxObjectStorage
- func (tx *ObjectStorage) Commit() error
- 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 (tx *ObjectStorage) Rollback() error
- func (s *ObjectStorage) Set(o core.Object) (core.Hash, error)
- func (s *ObjectStorage) Writer() (io.WriteCloser, error)
- type ReferenceStorage
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
Begin opens a new transaction. However, this implementation is not transactional, so Commit and Rollback have no effect.
func (*ObjectStorage) Commit ¶
func (tx *ObjectStorage) Commit() error
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) Rollback ¶
func (tx *ObjectStorage) Rollback() error
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