Documentation ¶
Index ¶
- Variables
- func Add(url string) error
- func GetModulePath(mod *model.Module) (string, error)
- func InitCache(path string)
- func New(url string) error
- func QueryGraphQL(url string, token string, q GraphQLQuery, res interface{}) error
- type Commit
- type ErrGitHubGQL
- type ErrGitHubGQLRateLimit
- type Git
- func (g *Git) Dir() (string, error)
- func (g *Git) EdeaParams(sub string) (map[string]interface{}, error)
- func (g *Git) ExportPlotDirAt(dest, dir, revision string) (string, error)
- func (g *Git) File(name string, caseSensitive bool) (string, error)
- func (g *Git) FileAt(name string, caseSensitive bool, revision string) ([]byte, error)
- func (g *Git) FileByExtAt(dir, ext, revision string) ([]byte, error)
- func (g *Git) FilesByExtAt(dir, ext, revision string) (files []GitFile, err error)
- func (g *Git) HasDocs(sub string) (bool, error)
- func (g *Git) History(folder string) ([]*Commit, error)
- func (g *Git) Pull() error
- func (g *Git) Readme(revision string) (string, error)
- func (g *Git) SubModuleDir(sub string) (string, error)
- func (g *Git) SubModuleDocs(sub string) (string, error)
- func (g *Git) SubModuleReadme(sub, revision string) (string, error)
- type GitFile
- type GitHub
- type GitLab
- type GitRepository
- type GraphQLQuery
- type GraphQLResponse
- type Info
- type Module
- type Project
- type RepoCache
- type Repository
Constants ¶
This section is empty.
Variables ¶
var ( ErrExists = errors.New("repository already added") ErrNoFile = errors.New("no file found") ErrBadCredentials = errors.New("bad credentials") ErrUnexpectedResponse = errors.New("unexpected http response") ErrUncachedRepo = errors.New("repository not cached") )
var ( // ErrCacheExists indicates a different repository whith the same cache folder already exists ErrCacheExists = errors.New("cache folder for new repository already exists") )
Functions ¶
func QueryGraphQL ¶
func QueryGraphQL(url string, token string, q GraphQLQuery, res interface{}) error
QueryGraphQL runs a GraphQL with the given parameters
Types ¶
type ErrGitHubGQL ¶
type ErrGitHubGQL struct {
Msg string
}
func (*ErrGitHubGQL) Error ¶
func (e *ErrGitHubGQL) Error() string
type ErrGitHubGQLRateLimit ¶
func (*ErrGitHubGQLRateLimit) Error ¶
func (e *ErrGitHubGQLRateLimit) Error() string
type Git ¶
type Git struct {
URL string
}
func (*Git) ExportPlotDirAt ¶
ExportPlotDirAt pulls all the plotted svg files from the repository at the specified revision and copies them to a temporary folder
func (*Git) FileAt ¶
FileAt searches for a given file with the specific revision in the git respository the revision parameter can be anything ResolveRevision understands (tags, branches, HEAD^1, etc.)
func (*Git) FileByExtAt ¶
FileByExtAt works like FilesByExtAt but only returns the first file found
func (*Git) FilesByExtAt ¶
FilesByExtAt searches for a given file by extension with the specific revision in the git respository the revision parameter can be anything ResolveRevision understands (tags, branches, HEAD^1, etc.) NOTE: ext *must* contain the . (dot), e.g. ".kicad_pcb"
func (*Git) HasDocs ¶
HasDocs searches for a book.toml file in the repository and returns true if found
func (*Git) History ¶
History returns the commits and the reference hash for a repository or submodule
func (*Git) SubModuleDir ¶
SubModuleDir looks if a sub-module exists or else returns the base path
func (*Git) SubModuleDocs ¶
SubModuleDocs searches for the doc subfolder in the module and returns all .md files
type GitRepository ¶
type GraphQLQuery ¶
type GraphQLQuery struct { Query string `json:"query"` OperationName string `json:"operationName,omitempty"` Variables interface{} `json:"variables,omitempty"` }
GraphQLQuery helper struct
type GraphQLResponse ¶
type GraphQLResponse struct { Message string `json:"message"` Errors []struct { Message string `json:"message,omitempty"` Locations []struct { Line int `json:"line,omitempty"` Column int `json:"column,omitempty"` } `json:"locations,omitempty"` } `json:"errors,omitempty"` Data interface{} `json:"data,omitempty"` }
GraphQLResponse struct
func (*GraphQLResponse) Error ¶
func (e *GraphQLResponse) Error() string
type Module ¶
type Module struct { Readme string `yaml:"readme"` // readme file or folder which contains readme.md Directory string `yaml:"dir"` // path to the kicad project file or folder which contains it Doc string `yaml:"doc"` // path to book.toml Params map[string]interface{} `yaml:"params"` // module parameters, used for search }
Module references the schematic and pcb for this module