revision

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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.

func (*Repository) Status

func (repo *Repository) Status() (gitgo.Status, error)

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.

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 NewService(path string) (*Service, error)

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.

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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