context

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFile is the name of the config file.
	ConfigFile = "config.json"
	// DefaultBranch is the name of the default branch.
	DefaultBranch = "main"
)
View Source
const DotDir = ".multi"

DotDir is the name of the dot directory.

Variables

View Source
var DefaultIgnore = ignore.New("", ".git", ".svn", ".hg", ".multi")

DefaultIgnore contans the default ignore rules.

Functions

func Init

func Init(cwd string) error

Init initializes a new context.

func Root

func Root(root string) (string, error)

Root searches for the repository root.

Types

type Branch

type Branch struct {
	// Head is the CID of the branch head.
	Head cid.Cid `json:"head"`
	// Stash is the CID of the tree stash.
	Stash cid.Cid `json:"stash"`
	// Remote is the remote branch path.
	Remote string `json:"remote"`
}

Branch contains branch info.

type Config

type Config struct {
	// Branch is the name of the current branch.
	Branch string `json:"branch"`
	// Branches contains named branches.
	Branches map[string]*Branch `json:"branches"`
	// Remotes contains named remotes.
	Remotes map[string]string `json:"remotes"`
	// contains filtered or unexported fields
}

Config contains repository info.

func NewConfig

func NewConfig(root string) *Config

New returns a config with default settings.

func (*Config) Read

func (c *Config) Read() error

Read reads the config from the path.

func (*Config) Write

func (c *Config) Write() error

Write writes the config to the path.

type Context

type Context struct {
	// Blocks is the ipfs blockstore.
	Blocks blockstore.Blockstore
	// Config contains repository settings.
	Config *Config
	// DAG contains all versioned files.
	DAG ipld.DAGService
	// Root is the top level directory.
	Root string
}

Context contains command context.

func New

func New(cwd string) (*Context, error)

New returns a new context.

Jump to

Keyboard shortcuts

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