filesystem

package
v4.0.0-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package filesystem is a storage backend base on filesystems

Index

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"`
}

func (*ConfigFile) Decode

func (c *ConfigFile) Decode(r io.Reader) error

Decode decode a git config file intro the ConfigStore

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

Get returns the object with the given hash, by searching for it in the packfile and the git object directories.

func (*ObjectStorage) Iter

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

func (s *ObjectStorage) Set(core.Object) (core.Hash, error)

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 (*ReferenceStorage) Iter

func (*ReferenceStorage) Set

func (r *ReferenceStorage) Set(ref *core.Reference) 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 (*TxObjectStorage) Rollback

func (tx *TxObjectStorage) Rollback() error

func (*TxObjectStorage) Set

func (tx *TxObjectStorage) Set(obj core.Object) (core.Hash, error)

Directories

Path Synopsis
internal
dotgit
https://github.com/git/git/blob/master/Documentation/gitrepository-layout.txt
https://github.com/git/git/blob/master/Documentation/gitrepository-layout.txt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL