core

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gi

type Gi struct {
	// contains filtered or unexported fields
}

Gi is the object to handle data of the remote repository.

func NewGi

func NewGi(repo Repository) *Gi

NewGi returns a new Gi object.

func (*Gi) Download

func (gi *Gi) Download(selected []string, w io.Writer) error

Download get the content of selected files and writes them merged.

func (*Gi) ListGitIgnorePath

func (gi *Gi) ListGitIgnorePath() ([]string, error)

ListGitIgnorePath returns the list that contains the filepath of gitignore.

type NodeType

type NodeType int

NodeType indicates the type of TreeNode object.

const (
	// NtBlob indicates that the Content Object is a blob.
	NtBlob NodeType = iota
	// NtTree indicates that the Content Object is a tree.
	NtTree
	// NtSubmodule indicates that the Content Object is a submodule.
	NtSubmodule
)

type Repository added in v0.2.0

type Repository interface {
	// GetTree returns contents sorted by the path.
	GetTree(ctx context.Context, recursive bool) ([]*TreeNode, error)
	// GetBlob returns the decoded content of the specified SHA.
	GetBlob(ctx context.Context, sha string) ([]byte, error)
}

Repository is the place that stores gitignore files

type TreeNode

type TreeNode struct {
	Type NodeType
	Path *string
	SHA  *string
}

TreeNode is the object that represents a content stored in the repository. NOTE: https://git-scm.com/book/en/v2/Git-Internals-Git-Objects/#_tree_objects

func NewTreeNode

func NewTreeNode(nodeType NodeType, path string, sha string) *TreeNode

NewTreeNode returns a new TreeNode object.

Jump to

Keyboard shortcuts

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