schema

package
v0.0.1-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SchemasPath string = "schemas"

Variables

This section is empty.

Functions

func MustNewWindowsCompatibleReferenceLoader

func MustNewWindowsCompatibleReferenceLoader(source string) gojsonschema.JSONLoader

func NewDuplicateCredentialsError

func NewDuplicateCredentialsError() error

func NewInvalidCredentialsError

func NewInvalidCredentialsError() error

func NewPasswordPolicyValidation

func NewPasswordPolicyValidation(value interface{}, reason string, context *gojsonschema.JsonContext) error

func NewRequiredError

func NewRequiredError(value interface{}, context *gojsonschema.JsonContext) error

func NewWindowsCompatibleReferenceLoader

func NewWindowsCompatibleReferenceLoader(source string) (_ gojsonschema.JSONLoader, err error)

NewWindowsCompatibleReferenceLoader returns a JSON reference loader using the given source and the local OS file system.

Types

type Extension

type Extension struct {
	Credentials struct {
		Password struct {
			Identifier bool `json:"identifier"`
		} `json:"password"`
	} `json:"credentials"`
	Mappings struct {
		Identity struct {
			Traits []struct {
				Path string `json:"path"`
			} `json:"traits"`
		} `json:"identity"`
	} `json:"mappings"`
}

type Handler

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

func NewHandler

func NewHandler(r handlerDependencies) *Handler

func (*Handler) RegisterPublicRoutes

func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic)

type HandlerProvider

type HandlerProvider interface {
	SchemaHandler() *Handler
}

type ResultErrors

type ResultErrors []gojsonschema.ResultError

func (ResultErrors) Error

func (e ResultErrors) Error() string

type Schema

type Schema struct {
	ID     string   `json:"id"`
	URL    *url.URL `json:"-"`
	RawURL string   `json:"url"`
}

func (*Schema) SchemaURL

func (s *Schema) SchemaURL(host *url.URL) *url.URL

type Schemas

type Schemas []Schema

func (Schemas) GetByID

func (s Schemas) GetByID(id string) (*Schema, error)

type ValidationExtender

type ValidationExtender interface {
	Call(node interface{}, extension *Extension, context *gojsonschema.JsonContext) error
}

type ValidationProvider

type ValidationProvider interface {
	SchemaValidator() *Validator
}

type Validator

type Validator struct {
	sync.RWMutex
}

func NewValidator

func NewValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(
	href string,
	object gojsonschema.JSONLoader,
	extensions ...ValidationExtender,
) error

Jump to

Keyboard shortcuts

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