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: 6 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址