hschema

package module
v0.0.0-...-8d17a4c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 6 Imported by: 10

README

go-jshschema

Build Status

GoDoc

JSON Hyper Schema for Go

TODO

  • Documentation!
  • Tests!

References

Name Notes
go-jsval Validator generator
go-jsschema JSON 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

This section is empty.

Types

type HyperSchema

type HyperSchema struct {
	*schema.Schema
	PathStart string   `json:"pathStart,omitempty"`
	Links     LinkList `json:"links,omitempty"`
	Media     Media    `json:"media,omitempty"`
}

func New

func New() *HyperSchema

func Read

func Read(in io.Reader) (*HyperSchema, error)

func ReadFile

func ReadFile(f string) (*HyperSchema, error)

func (*HyperSchema) Decode

func (s *HyperSchema) Decode(in io.Reader) error

func (*HyperSchema) Extract

func (s *HyperSchema) Extract(m map[string]interface{}) (err error)
type Link struct {
	Href         string         `json:"href"`
	Rel          string         `json:"rel"`
	Title        string         `json:"title,omitempty"`
	TargetSchema *schema.Schema `json:"targetSchema,omitempty"`
	MediaType    string         `json:"mediaType,omitempty"`
	Method       string         `json:"method,omitempty"`
	EncType      string         `json:"encType,omitempty"`
	Schema       *schema.Schema `json:"schema,omitempty"`
	Extras       map[string]interface{}
	// contains filtered or unexported fields
}

func (*Link) Extract

func (l *Link) Extract(v interface{}) (err error)

func (Link) Parent

func (l Link) Parent() *HyperSchema

func (*Link) Path

func (l *Link) Path() string

func (*Link) SetParent

func (l *Link) SetParent(s *HyperSchema)
type LinkList []*Link

func (*LinkList) Extract

func (ll *LinkList) Extract(v interface{}) error

func (*LinkList) SetParent

func (ll *LinkList) SetParent(s *HyperSchema)

type Media

type Media struct {
	Type           string `json:"type"`
	BinaryEncoding string `json:"binaryEncoding"`
}

func (*Media) Extract

func (m *Media) Extract(v interface{}) error

Jump to

Keyboard shortcuts

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