parser

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package parser is an API blueprint parser and renderer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(name string, engine Parser) (*api.API, error)

Load reads API blueprint from file as blueprint.API struct using selected Parser

func LoadAsJSON added in v1.0.0

func LoadAsJSON(name string, engine Parser) ([]byte, error)

LoadAsJSON reads API blueprint from file as API Element JSON using selected Parser

func Parse

func Parse(r io.Reader, engine Parser) (*api.API, error)

Parse formats API blueprint as blueprint.API struct using selected Parser

func ParseAsJSON added in v1.0.0

func ParseAsJSON(r io.Reader, engine Parser) ([]byte, error)

ParseAsJSON parse API blueprint as API Element JSON

func Read

func Read(name string) ([]byte, error)

Read reads API blueprint from file as bytes

func Seeds added in v1.1.0

func Seeds(name string) []string

Seeds lists filenames of API blueprint's seeds.

func Validate

func Validate(r io.Reader, engine Parser) (*api.API, error)

Validate validates API blueprint using selected Parser

Types

type Parser

type Parser interface {
	Parse(r io.Reader) ([]byte, error)
	Validate(r io.Reader) ([]byte, error)
	Version() string
}

Jump to

Keyboard shortcuts

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