project

package
v1.2.5-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodeBlocks added in v1.2.0

func GetCodeBlocks(filepath string, allowUnknown bool, allowUnnamed bool, fs billy.Basic) (document.CodeBlocks, error)

func GetCodeBlocksAndParseFrontmatter added in v1.2.1

func GetCodeBlocksAndParseFrontmatter(filepath string, allowUnknown bool, allowUnnamed bool, fs billy.Basic) (document.CodeBlocks, document.Frontmatter, error)

func GetCurrentGitEmail

func GetCurrentGitEmail(cwd string) (string, error)

func ReadMarkdownFile added in v1.2.0

func ReadMarkdownFile(filepath string, fs billy.Basic) ([]byte, error)

Types

type Branch

type Branch struct {
	Name        string
	Description string
}

func GetBranchNames

func GetBranchNames(cwd string) ([]Branch, error)

func GetRepoBranches

func GetRepoBranches() ([]Branch, error)

func GetUsersBranchNames

func GetUsersBranchNames(cwd string, email string) ([]Branch, error)

func GetUsersBranches

func GetUsersBranches(repoUser string) ([]Branch, error)

type CodeBlock added in v1.2.0

type CodeBlock struct {
	Block       *document.CodeBlock
	File        string
	Frontmatter document.Frontmatter
	// contains filtered or unexported fields
}

func (CodeBlock) Clone added in v1.2.1

func (b CodeBlock) Clone() *CodeBlock

func (CodeBlock) GetBlock added in v1.2.0

func (b CodeBlock) GetBlock() *document.CodeBlock

func (CodeBlock) GetFile added in v1.2.0

func (b CodeBlock) GetFile() string

func (CodeBlock) GetFileRel added in v1.2.1

func (b CodeBlock) GetFileRel() string

func (CodeBlock) GetFrontmatter added in v1.2.1

func (b CodeBlock) GetFrontmatter() document.Frontmatter

func (CodeBlock) GetID added in v1.2.0

func (b CodeBlock) GetID() string

type CodeBlockFS added in v1.2.1

type CodeBlockFS interface {
	billy.Basic
	billy.Chroot
}

type CodeBlocks added in v1.2.0

type CodeBlocks []CodeBlock

func (CodeBlocks) Lookup added in v1.2.0

func (blocks CodeBlocks) Lookup(queryName string) []CodeBlock

func (CodeBlocks) LookupByFile added in v1.2.0

func (blocks CodeBlocks) LookupByFile(queryFile string) ([]CodeBlock, error)

func (CodeBlocks) LookupByID added in v1.2.0

func (blocks CodeBlocks) LookupByID(query string) ([]CodeBlock, error)

func (CodeBlocks) LookupWithFile added in v1.2.0

func (blocks CodeBlocks) LookupWithFile(queryFile string, queryName string) ([]CodeBlock, error)

func (CodeBlocks) Names added in v1.2.0

func (blocks CodeBlocks) Names() []string

type DirectoryProject added in v1.2.0

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

func NewDirectoryProject added in v1.2.0

func NewDirectoryProject(dir string, findNearestRepo bool, allowUnknown bool, allowUnnamed bool, ignorePatterns []string) (*DirectoryProject, error)

func (*DirectoryProject) Dir added in v1.2.0

func (p *DirectoryProject) Dir() string

func (*DirectoryProject) EnvLoadOrder added in v1.2.0

func (p *DirectoryProject) EnvLoadOrder() []string

func (*DirectoryProject) LoadEnvs added in v1.2.0

func (p *DirectoryProject) LoadEnvs() (map[string]string, error)

func (*DirectoryProject) LoadTasks added in v1.2.0

func (p *DirectoryProject) LoadTasks() (CodeBlocks, error)

func (*DirectoryProject) SetEnvLoadOrder added in v1.2.0

func (p *DirectoryProject) SetEnvLoadOrder(envLoadOrder []string)

func (*DirectoryProject) SetRespectGitignore added in v1.2.0

func (p *DirectoryProject) SetRespectGitignore(respectGitignore bool)

type DirectoryProjectMatcher added in v1.2.0

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

TODO(mxs): support `.runmeignore` file

func (*DirectoryProjectMatcher) Match added in v1.2.0

func (m *DirectoryProjectMatcher) Match(path []string, isDir bool) bool

type ErrCodeBlockFileNotFound added in v1.2.0

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

func (ErrCodeBlockFileNotFound) Error added in v1.2.0

func (e ErrCodeBlockFileNotFound) Error() string

func (ErrCodeBlockFileNotFound) FailedFileQuery added in v1.2.0

func (e ErrCodeBlockFileNotFound) FailedFileQuery() string

type ErrCodeBlockNameNotFound added in v1.2.0

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

func (ErrCodeBlockNameNotFound) Error added in v1.2.0

func (e ErrCodeBlockNameNotFound) Error() string

func (ErrCodeBlockNameNotFound) FailedNameQuery added in v1.2.0

func (e ErrCodeBlockNameNotFound) FailedNameQuery() string

type FileCodeBlock added in v1.2.0

type FileCodeBlock interface {
	GetBlock() *document.CodeBlock

	// relative to project root
	GetFileRel() string

	// absolute file path
	GetFile() string
	GetFrontmatter() document.Frontmatter
}

type Project

type Project interface {
	LoadTasks() (CodeBlocks, error)
	LoadEnvs() (map[string]string, error)
	EnvLoadOrder() []string
	Dir() string
}

type Resolver

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

func NewResolver

func NewResolver(dir string) *Resolver

type SingleFileProject added in v1.2.0

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

func NewSingleFileProject added in v1.2.0

func NewSingleFileProject(file string, allowUnknown bool, allowUnnamed bool) *SingleFileProject

func (*SingleFileProject) Dir added in v1.2.0

func (p *SingleFileProject) Dir() string

func (*SingleFileProject) EnvLoadOrder added in v1.2.0

func (p *SingleFileProject) EnvLoadOrder() []string

func (*SingleFileProject) LoadEnvs added in v1.2.0

func (p *SingleFileProject) LoadEnvs() (map[string]string, error)

func (*SingleFileProject) LoadTasks added in v1.2.0

func (p *SingleFileProject) LoadTasks() (CodeBlocks, error)

Jump to

Keyboard shortcuts

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