repo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Config = "multi.json"

Config is the name of the repo config file.

Variables

View Source
var (
	ErrRepoExists   = errors.New("repo already exists")
	ErrRepoNotFound = errors.New("repo not found")
)

Functions

This section is empty.

Types

type Repo

type Repo struct {
	// Path to repo root.
	Path string `json:"-"`
	// CID of repo head.
	Head cid.Cid `json:"head"`
}

Repo contains repo info.

func Init

func Init(path string) (*Repo, error)

Init creates a new empty repo at the given path.

func Open

func Open(path string) (*Repo, error)

Open returns an existing repo in the current or parent directories.

func Read

func Read(path string) (*Repo, error)

Read returns an existing repo in the current directory.

func (*Repo) Write

func (r *Repo) Write() error

Write saves the repo config to the root directory.

Jump to

Keyboard shortcuts

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