core

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 5 Imported by: 0

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