Generates Golang code with enums from TOML specification

enum-generator

This enum-generator is intended to generate golang source code for string-based enum types and enum types with associated data from description in TOML.

How to use

This command:

enum-generator -enable-json -enable-bson -package=mypackage < enums.toml > enums.go

will make source file enums.go for "mypackage" Go package with enum types defined in enums.toml, with JSON and BSON (un)marshalling functions included.

Flags:

  • -package=packagename - sets name "packagename" for a package ("main" if not set)
  • -enable-json - JSON (un)marshalling functions for generated types are included to source code
  • -enable-bson - same for BSON

TOML structure sample:

[Figure]
default = "Dot"
[Figure.variants]
Rectangle = "rect"
Circle    = "circle"
Dot       = "dot"

[FigureInfo]
constraint = "Figure"
[FigureInfo.Variants]
Rectangle = "RectangleData"
Circle    = "int"
"Dot"     = "null"`

Made in Wimark Systems.

Owner
WiMark Systems
Bring's into the World the platform for manage, authorize and monetize Wi-Fi networks
WiMark Systems
Similar Resources

Code generation for golang's constructor

constructor Generate constructor for a given struct. Usage of constructor: -exclude string the fields to exclude. Use comma to specify multi

Dec 26, 2021

Golang Base Code

Golang Base Code Getting Started Clone repository. git clone [email protected]:mo-t

Dec 14, 2022

Morse Code Library in Go

morse Morse Code Library in Go Download and Use go get -u -v github.com/alwindoss/morse or dep ensure -add github.com/alwindoss/morse Sample Usage pac

Dec 30, 2022

Automatically generate Go test boilerplate from your source code.

Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Jan 3, 2023

XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator

xgen Introduction xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This li

Jan 1, 2023

Get user-like access to VirtualBox VMs from Go code.

#Vboxgo Get user-like access to VirtualBox VMs from Go code. This library wraps some define-tainted VirtualBox SDK functions, making it possible to ge

Oct 25, 2021

WeCTF 2020+ Source Code & Organizer's Writeup

WeCTF 2020+ Thank you all for participating! This README contains our writeup sketches. You can also share your writeup on CTFtime. Event Link: https:

Jul 6, 2022

Visualize how a projects source code is distributed among its files and folders

Visualize how a projects source code is distributed among its files and folders

Source Code Visualizer Visualize the code distribution in a project. Applications Applications include: Visualizing code distribution for more educate

Jul 31, 2022

Jennifer is a code generator for Go

Jennifer Jennifer is a code generator for Go. package main import ( "fmt" . "github.com/dave/jennifer/jen" ) func main() { f := NewFile("m

Dec 25, 2022
An application that is developed to generate application by API specification

GO boilerplate is an application that is developed to generate application by API specification and Database schema with the collaboration with opn-generator.

Oct 14, 2021
DSV Parallel Processor takes input files and query specification via a spec file

DSV Parallel Processor Spec file DSV Parallel Processor takes input files and query specification via a spec file (conventionally named "spec.toml").

Oct 9, 2021
RTS: request to struct. Generates Go structs from JSON server responses.

RTS: Request to Struct Generate Go structs definitions from JSON server responses. RTS defines type names using the specified lines in the route file

Dec 7, 2022
🦉 Docuowl generates a static single-page documentation from Markdown files
🦉 Docuowl generates a static single-page documentation from Markdown files

?? Docuowl generates a static single-page documentation from Markdown files

Jan 2, 2023
The High Code Framework (low-code for devs)

hof - the high code framework The hof tool tries to remove redundent development activities by using high level designs, code generation, and diff3 wh

Dec 24, 2022
🎄 My code for the Advent of Code of year 2021 in Go.

Advent of Code 2021 This repository contains all code that I wrote for the Advent of Code 2021. This year I chose to try and learn Go. Enjoy! Built wi

Dec 9, 2021
Auto-evaluate your Golang code.
Auto-evaluate your Golang code.

Ginker Ginker is a GUI application for auto-evaluating your Golang code. It allows you to write and run Golang code on the fly and it will help you to

Jun 24, 2021
Golang Code Challenge for PARSPOOYESH

golang-code-challenge Dependencies You must have go and Docker installed on your machine also you need to go get this Dependencies: name repo gorilla/

Mar 18, 2022
General Golang Code Generator

gg gg is a General Golang Code Generator: A Good Game to play with Golang. package main import ( "fmt" . "github.com/Xuanwo/gg" ) func main() {

Jan 7, 2023
Advent of code solutions in Golang

Advent of Code go solutions This repo contains my solutions in Golang for advent of code (P.S: I am using this opportunity to learn new language most

Dec 21, 2021