An open API service indexing awesome lists of open source software.

https://github.com/nikitaksv/gendata

Template Data Generator - JSON To GoLang, PHP and other
https://github.com/nikitaksv/gendata

codegenerator datagen generator golang jsoncafe jsongen php template

Last synced: 3 months ago
JSON representation

Template Data Generator - JSON To GoLang, PHP and other

Awesome Lists containing this project

README

          

# GenData

[![Godoc Reference](https://godoc.org/github.com/nikitaksv/gendata?status.svg)](http://godoc.org/github.com/nikitaksv/gendata)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/nikitaksv/gendata)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nikitaksv/gendata/release)
[![codecov](https://codecov.io/gh/nikitaksv/gendata/branch/main/graph/badge.svg?token=TDDP71X62E)](https://codecov.io/gh/nikitaksv/gendata)
![License](https://img.shields.io/github/license/nikitaksv/gendata)

---

Template Data Generator

## Wiki

[Doc](https://github.com/nikitaksv/gendata/wiki)
[Syntax](https://github.com/nikitaksv/gendata/wiki/Syntax)
[Examples](https://github.com/nikitaksv/gendata/wiki/Examples)

## Installation

Follow those steps to install the library:

1. Import the library our code:

```shell
go get github.com/nikitaksv/gendata
```

or install cli tool

```shell
go install github.com/nikitaksv/gendata
```

## Usage

### CLI

```shell
gendata gen -l go -t testdata/template.txt -d testdata/data.json -o testdata/
```

### Code example PHP Class generator from JSON data:

```go
package main

import (
"bytes"
"context"
"fmt"
"log"

gendata "github.com/nikitaksv/gendata/pkg/service"
)

func main() {
tmpl := []byte(`