codebase

package
v0.0.0-...-1d0deca Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 9 Imported by: 0

README

CodeBaseManager - Codebase (Repository Management)

The goal of this module is to allow the user to describe repository for their Project through simple TOML files.

Furthermore, Basic Cat and Find Tools (for files and functions) are implemented.

Repository

In .cbm folder, there is a toml file called repository.toml

This file allow you to configure some features such as:

Language = []
Modules = []
Tests = []
Details

Each line represent a feature that can be specified:

These fields are mandatory for now.

Fields Usage Type Remark
Language Project language list Array of string Mandatory
Modules Project sources dependencies Array of string Mandatory
Tests Folders that contains tests Array of string Mandatory

Codebase Tools

Theses tools allow the user to quickly find some information.

Fields Usage Description
Find cbm codebase find [args] Find requested files or functions
Cat cbm codebase cat [args] Display requested files or functions
Language Remark
C Normal, static and static inlines functions
Go Functions
Python Functions and methods, with decorators

Documentation

Index

Constants

View Source
const FILEPATH_REPOSITORY = "./.cbm/template/test.toml"

Variables

View Source
var CManager = Manager{
	Language:   "C",
	Extensions: []string{".c", ".h"},
}
View Source
var GoManager = Manager{
	Language:   "Go",
	Extensions: []string{".go"},
}
View Source
var ManagedLangage = map[string]Manager{
	"C":  CManager,
	"Go": GoManager,
}

Functions

func GetFile

func GetFile(fileName string) (*string, error)

func ProcessModules

func ProcessModules(moduleList *Repository, module *Module, path string)

Types

type FileParser

type FileParser struct {
	Path, Name string
}

func (FileParser) String

func (f FileParser) String() string

type Manager

type Manager struct {
	Language   string
	Extensions []string
}

type Module

type Module struct {
	Path, Name string
	Files      []*FileParser
}

func (*Module) Append

func (m *Module) Append(path, name string) *FileParser

func (Module) IsEmpty

func (m Module) IsEmpty() bool

func (Module) String

func (m Module) String() string

type RepoTemplate

type RepoTemplate struct {
	Language []string `toml:"Language"`
	Modules  []string `toml:Modules`
	Tests    []string `toml:Tests`
}

func GetTomlRepo

func GetTomlRepo(filepath string) (*RepoTemplate, error)

type Repository

type Repository struct {
	Modules []*Module
}

func ParseRepository

func ParseRepository(path string) (*Repository, error)

func (*Repository) Append

func (r *Repository) Append(path, name string) *Module

func (*Repository) Clean

func (r *Repository) Clean()

func (Repository) String

func (r Repository) String() string

Jump to

Keyboard shortcuts

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