reporeader

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeRepoReader added in v0.0.34

type FakeRepoReader struct {
	Files map[string][]byte
}

FakeRepoReader is a RepoReader that can be used for testing, and takes a list of relative file paths with their contents

func (FakeRepoReader) Exists added in v0.0.34

func (r FakeRepoReader) Exists(path string) bool

func (FakeRepoReader) FindFiles added in v0.0.34

func (r FakeRepoReader) FindFiles(path string, patterns []string, maxDepth int) ([]string, error)

func (FakeRepoReader) GetRepoName added in v0.0.34

func (FakeRepoReader) GetRepoName() (string, error)

GetRepoName returns the name of the repo

func (FakeRepoReader) ReadFile added in v0.0.34

func (r FakeRepoReader) ReadFile(path string) ([]byte, error)

type RepoReader

type RepoReader interface {
	Exists(path string) bool
	ReadFile(path string) ([]byte, error)
	// FindFiles returns a list of files that match the given patterns searching up to
	// maxDepth nested sub-directories. maxDepth of 0 limits files to the root dir.
	FindFiles(path string, patterns []string, maxDepth int) ([]string, error)
	GetRepoName() (string, error)
}

type VariableExtractor

type VariableExtractor interface {
	ReadDefaults(r RepoReader) (map[string]string, error)
	MatchesLanguage(lowerlang string) bool
	GetName() string
}

VariableExtractor is an interface that can be implemented for extracting variables from a repo's files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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