backero

package module
v0.0.0-...-222df54 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Backero

Codecov

Backero is the infrastructure that allows you to create and implement multiple targets for the backend of a programming language.

Example usage

NOTE: This sample code is currently a long way from being implementable, but it is a goal.

package main

import(
	"fmt"

	"github.com/dilmorja/backero"
	"github.com/dilmorja/backero/targets/ts"
	"github.com/dilmorja/backero/targets/ts/types"
)

func main() {
	vaquero := backero.New()
	vaquero.LoadAndUse(ts.TypeScript())

	mod := vaquero.InitModule("constant")
	mod.Const("x", types.String, "This is a constant", false)

	fmt.Println(mod.String()) // const x: string = "This is a constant"
	fmt.Println(mod.Memory["const"]["x"].Content()) // "This is a constant"
}

Why Go (Golang)?

It's simple: go is easy to learn, relatively modern, scalable, and its standard modular structure is intuitive.

License

BSD 3-Clause

Documentation

Overview

Backero is like a framework that facilitates the creation and implementation of targets in the creation of programming languages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cowboy

type Cowboy struct {
	*Target

	Targets map[string]*Target
	// contains filtered or unexported fields
}

An implementation that handles targets

func New

func New() *Cowboy

Create an empty (but not nil) *Cowboy structure

func (*Cowboy) Load

func (c *Cowboy) Load(target *Target) error

Append a new target to the map

func (*Cowboy) LoadAndUse

func (c *Cowboy) LoadAndUse(tar *Target) error

Load and use the given target

func (*Cowboy) NilTargets

func (c *Cowboy) NilTargets() bool

Quickly check if the map that stores the targets is not nil

func (*Cowboy) Use

func (c *Cowboy) Use(tarname string) error

Returns a copy of the previous structure that only replaces the target to use.

type Target

type Target struct {
	ID UTI
}

An implementation that handles code generation.

type UTI

type UTI struct {
	Name    string
	Version string
	Hosts   string
}

Unique Target Identification

func (UTI) String

func (u UTI) String() string

Uses the values of the fields and returns a formatted string

Directories

Path Synopsis
framework
targets
ts

Jump to

Keyboard shortcuts

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