Documentation
¶
Index ¶
- Constants
- Variables
- func GlobalLocation() (string, error)
- type Person
- type Project
- func (p *Project) AddDocumentToIndex(doc *pb.Document) error
- func (p *Project) Branch(name string) (map[string]*pb.Document, error)
- func (p *Project) CleanupWorkdir(dir string) error
- func (p *Project) Commit(refname string, author, committer Person, message string) (commitOid string, err error)
- func (p *Project) DocFromIndex(path string) (*pb.Document, error)
- func (p *Project) Fetch(remoteName string, refspecs ...string) error
- func (p *Project) FetchAnonymous(url string, refspecs ...string) error
- func (p *Project) GetDocument(revision, path string) (*pb.Document, error)
- func (p *Project) Head() (map[string]*pb.Document, error)
- func (p *Project) Index() (docs map[string]*pb.Document, err error)
- func (p *Project) Pull(remoteName, refspec string) error
- func (p *Project) Push(remoteName string, refspecs ...string) error
- func (p *Project) Remotes() *git.RemoteCollection
- func (p *Project) ResolveCommit(revision string) (map[string]*pb.Document, error)
- func (p *Project) TempWorkdir() (string, error)
Constants ¶
View Source
const ( // SpreadDirectory is the name of the directory that holds a Spread repository. SpreadDirectory = ".spread" // GitDirectory is the name of the directory holding the bare Git repository within the SpreadDirectory. GitDirectory = "git" )
Variables ¶
View Source
var ( // ErrEmptyPath is returned when a target string is empty. ErrEmptyPath = errors.New("path must be specified") // ErrPathNotDir is returned when a target is a file and is expected to be a directory. ErrPathNotDir = errors.New("a directory must be specified") )
View Source
var (
ErrNilObjectInfo = errors.New("an object's Info field cannot be nil")
)
View Source
var ( // GlobalPath is the path that holds the Spread global repository for a user. The '~' character may be used // to denote the home directory of a user across platforms. GlobalPath = "~/.spread-global" )
Functions ¶
func GlobalLocation ¶
GlobalLocation returns the path of the global project. An error is returned if the path doesn't exist.
Types ¶
type Project ¶
type Project struct {
Path string
// contains filtered or unexported fields
}
func InitGlobal ¶
InitGlobal initializes the global repository for this user.
func InitProject ¶
InitProject creates a new Spread project including initializing a Git repository on disk. A target must be specified.
func OpenProject ¶
OpenProject attempts to open the project at the given path.
func (*Project) CleanupWorkdir ¶
CleanupWorkdir removes the given directory and sets the repositories Workdir to an empty string.
func (*Project) FetchAnonymous ¶
func (*Project) GetDocument ¶
func (*Project) Remotes ¶
func (p *Project) Remotes() *git.RemoteCollection
func (*Project) ResolveCommit ¶
func (*Project) TempWorkdir ¶
TempWorkdir creates a temporary directory and configures the Repository to use it as a work dir. HEAD is checked out to the temporary working directory. The path of the working directory is returned as a string.
Click to show internal directories.
Click to hide internal directories.