Documentation ¶
Index ¶
- Constants
- Variables
- type DiffFile
- type PublishStats
- type Publisher
- type PublisherStats
- type Repository
- func (repo *Repository) Add(path string) error
- func (repo *Repository) Changes(path, from, until string) (chan DiffFile, error)
- func (repo *Repository) Commit(msg string, options *gitgo.CommitOptions) (plumbing.Hash, error)
- func (repo *Repository) Exists(path string) bool
- func (repo *Repository) HEAD() (plumbing.Hash, error)
- func (repo *Repository) IsClean() bool
- func (repo *Repository) Publish(msg string) (PublisherStats, error)
- func (repo *Repository) PublishChanged(from, until string, p ...Publisher) (PublishStats, error)
- func (repo *Repository) Read(path, revision string) (io.ReadCloser, error)
- func (repo *Repository) ResetPath(path string) 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
- type State
Constants ¶
const (
WorkingVersion = "working-version"
)
Variables ¶
var (
ErrFileNotFound = errors.New("file not found")
)
var ErrRepositoryNotExists = errors.New("repository does not exist")
Functions ¶
This section is empty.
Types ¶
type PublishStats ¶ added in v0.2.0
type Publisher ¶ added in v0.2.0
type Publisher interface {
Publish(ctx context.Context, messages ...*domainpb.IndexMessage) error
}
type PublisherStats ¶ added in v0.2.0
type Repository ¶
func (*Repository) Add ¶
func (repo *Repository) Add(path string) error
Add adds all files with path to the staging area.
func (*Repository) Changes ¶ added in v0.2.0
func (repo *Repository) Changes(path, from, until string) (chan DiffFile, error)
func (*Repository) Commit ¶
func (repo *Repository) Commit(msg string, options *gitgo.CommitOptions) (plumbing.Hash, error)
func (*Repository) Exists ¶ added in v0.2.0
func (repo *Repository) Exists(path string) bool
func (*Repository) IsClean ¶ added in v0.2.0
func (repo *Repository) IsClean() bool
func (*Repository) Publish ¶ added in v0.2.0
func (repo *Repository) Publish(msg string) (PublisherStats, error)
func (*Repository) PublishChanged ¶ added in v0.2.0
func (repo *Repository) PublishChanged(from, until string, p ...Publisher) (PublishStats, 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) ResetPath ¶ added in v0.2.0
func (repo *Repository) ResetPath(path string) error
ResetPath removes all entries for a directory path.
This functionality allows full reingests to mark deleted entries.
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.
func (*Repository) Write ¶
func (repo *Repository) Write(path string, r io.Reader) error
Write writes the content of io.Reader to a file at path. When the file does not exist a new file is created.
You must repo.Add with the path before it can be committed.
An error is only returned when creating or write to the file fails.
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.