lang

package module
v0.0.0-...-841437a Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 2 Imported by: 2

README

Ranvier lang

The "compiler" for converting the config schema files into config that an application can consume.

Installation

go get github.com/eddieowens/ranvier/lang

Usage

package main

import (
  "fmt"
  "github.com/eddieowens/ranvier/lang"
  "github.com/eddieowens/ranvier/lang/compiler"
)

func main() {
  compiler := lang.NewCompiler()
  schema, err := compiler.Compile("path/to/config.json", compiler.CompileOptions{
  	ParseOptions: compiler.ParseOptions{
  		// The base directory housing the config.json file
  		Root: "/",
  	},
  })
  if err != nil {
    panic(err)
  }
  
  // Prints path-to-config
  fmt.Println(schema.Name)
}

The above will compile the path/to/config.json file and all of its dependencies into a single JSON file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompiler

func NewCompiler() compiler.Compiler

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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