jstmpl

package module
v0.0.0-...-1ef3636 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2016 License: MIT Imports: 10 Imported by: 0

README

go-jstmpl

Template renderer using JSON Schema as data

Installation

go get -u github.com/go-jstmpl/go-jstmpl/cmd/jstmpl

Usage

jstmpl -s schema.json -t schema/template
jstmpl -s schema.yml -t schema/template

Features

  • Can generate structs and validators in Go from JSON Schema definitions.
  • Can generate router, controllers and mock server in Go from JSON Schema links.
  • Can generate models and validators in TypeScript from JSON Schema definitions.
  • Can generate model fetcher in TypeScript from JSON Schema links.

And more ...

References

Name Notes
go-jsschema JSON Schema implementation
go-jshschema JSON Hyper Schema implementation
go-jsref JSON Reference implementation
go-jspointer JSON Pointer implementations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(s, t *schema.Schema, ctx *types.Context) (types.Schema, error)

Types

type Builder

type Builder struct {
	Schema *schema.Schema
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build(hs *hschema.HyperSchema) (*types.Root, error)

type FormatError

type FormatError struct {
	// contains filtered or unexported fields
}

func NewFormatError

func NewFormatError(e error) FormatError

func (FormatError) Error

func (err FormatError) Error() string

type Generator

type Generator struct{}

func NewGenerator

func NewGenerator() *Generator

func (*Generator) Process

func (g *Generator) Process(model *types.Root, tmpl []byte, ext string) ([]byte, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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