lang

package
v0.0.0-...-f79620d Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LanguageSupported

func LanguageSupported(language string) error

LanguageSupported returns and error if argument language is not contained in the language registry

func RegisterLanguage

func RegisterLanguage(language string, project ProjectBuilder) error

RegisterLanguage allows modules in package lang to register themselves

Types

type GolangProject

type GolangProject Project

func (*GolangProject) Build

func (p *GolangProject) Build() error

func (*GolangProject) CheckNamingConventions

func (p *GolangProject) CheckNamingConventions(name string) error

type Project

type Project struct {
	Name         string
	Language     string
	ProjectItems []ProjectItem
}

Project represents a project in a certain language

type ProjectBuilder

type ProjectBuilder interface {
	CheckNamingConventions(name string) error
	Build() error
}

ProjectBuilder is an interface that builder objects implement within the lang package

func GetProject

func GetProject(language string) ProjectBuilder

type ProjectItem

type ProjectItem struct {
	Name       string
	Parent     string //TODO: does go have a "directory"/file object
	Permission os.FileMode
	Content    string
}

projectItem represents an item in a project

type PythonProject

type PythonProject Project

func (*PythonProject) Build

func (p *PythonProject) Build() (err error)

func (*PythonProject) CheckNamingConventions

func (p *PythonProject) CheckNamingConventions(name string) error

type Registry

type Registry map[string]ProjectBuilder

Projects type stores builders for every language

Jump to

Keyboard shortcuts

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