Documentation
¶
Index ¶
- Variables
- type Repository
- func (repo *Repository) Add(path string) error
- func (repo *Repository) Commit(msg string, options *gitgo.CommitOptions) (plumbing.Hash, error)
- func (repo *Repository) Read(path, revision string) (io.ReadCloser, error)
- func (repo *Repository) SingleFlight(path string, r io.Reader, commitMessage string) (plumbing.Hash, error)
- func (repo *Repository) Status() (gitgo.Status, error)
- func (repo *Repository) Write(path string, r io.Reader) error
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRepositoryNotExists = errors.New("repository does not exist")
)
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) Add ¶
func (repo *Repository) Add(path string) error
Add adds all files with path to the staging area.
func (*Repository) Commit ¶
func (repo *Repository) Commit(msg string, options *gitgo.CommitOptions) (plumbing.Hash, error)
func (*Repository) Read ¶
func (repo *Repository) Read(path, revision string) (io.ReadCloser, error)
Read returns a Reader for the given path for a specific revision. When the revision is empty the HEAD version in returned.
func (*Repository) SingleFlight ¶
func (repo *Repository) SingleFlight(path string, r io.Reader, commitMessage string) (plumbing.Hash, error)
SingleFlight writes io.Reader to path and creates a commit with commitMessage.
type Service ¶
type Service struct { BareRepo bool // contains filtered or unexported fields }
func NewService ¶
func (*Service) InitRepository ¶
func (s *Service) InitRepository(organization, dataset string) (*Repository, error)
InitRepository initializes a Repository and returns it.
An error is only returned if there are underlying FS errors.
func (*Service) OpenRepository ¶
func (s *Service) OpenRepository(organization, dataset string) (*Repository, error)
OpenRepository returns an *Repository. When the Repository is not initialized or does not exist a ErrRepositoryNotExists is returned.
To create a repository you need to call InitRepository.
Click to show internal directories.
Click to hide internal directories.