Code Monkey home page Code Monkey logo

moz's Introduction

Moz

Moz exists has a library to provide a solid foundation for code generation by combining functional composition and Go ast for flexible content creation.

Install

go get -u github.com/influx6/moz

Introduction

Moz is a code generator which builds around the concepts of pluggable io.WriteTo elements that allow a elegant but capable system for generating code programmatically.

It uses functional compositions to define code structures that connect to create contents and using the Go ast parser, generates elegant structures for easier interaction with source files.

Features

  • Basic Programming structures
  • Simple Coding Blocks
  • Go text/template support
  • Annotation code generation

Projects Using Moz

Code Generation with Moz

Moz is intended to be very barebones and minimal, it focuses around providing very basic structures, that allows the most flexibility in how you generate new content.

It provides two packages that are the center of it's system:

Gen provides compositional structures for creating content with functions.

Generate Go struct using Gen

import "github.com/influx6/moz/gen"

floppy := gen.Struct(
		gen.Name("Floppy"),
		gen.Commentary(
			gen.Text("Floppy provides a basic function."),
			gen.Text("Demonstration of using floppy API."),
		),
		gen.Annotations(
			"Flipo",
			"API",
		),
		gen.Field(
			gen.Name("Name"),
			gen.Type("string"),
			gen.Tag("json", "name"),
		),
)

var source bytes.Buffer

floppy.WriteTo(&source) /*
// Floppy provides a basic function.
//
// Demonstration of using floppy API.
//
//
//@Flipo
//@API
type Floppy struct {

    Name string `json:"name"`

}
*/

Contributors

Please feel welcome to contribute with issues and PRs to improve Moz. :)

moz's People

Contributors

influx6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

linkerlin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.