jsonschema

package
v0.0.0-...-2ca1e88 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Cluster ...
	Cluster *gocb.Cluster
)

Functions

func Bind

func Bind(name string, body []byte) (map[string]interface{}, error)

func Create

func Create(data map[string]interface{}, nameSchema string) (map[string]interface{}, string, error)

func CreateBucket

func CreateBucket(name string)

CreateBucket ...

func CreateBuckets

func CreateBuckets(folderConfig string)

func Form

func Form(name string) (string, error)

func GetElementByID

func GetElementByID(id string, nameSchema string) (map[string]interface{}, error)

func InitDB

func InitDB()

InitDB ..

func Remove

func Remove(id, nameSchema string) (map[string]interface{}, error)

func Replace

func Replace(data map[string]interface{}, id string, nameSchema string) (map[string]interface{}, error)

Types

type JSONSchame

type JSONSchame struct {
	Schema           *string                `json:"$schema,omitempty"`
	ID               *string                `json:"$id,omitempty"`
	Title            *string                `json:"title,omitempty"`
	Description      *string                `json:"description,omitempty"`
	Type             string                 `json:"type"`
	Properties       *map[string]JSONSchame `json:"properties,omitempty"`
	Required         *[]string              `json:"required,omitempty"`
	ExclusiveMinimum *float64               `json:"exclusiveMinimum,omitempty"`
	ExclusiveMaximum *float64               `json:"exclusiveMaximum,omitempty"`
	Minimum          *float64               `json:"minimum,omitempty"`
	Maximum          *float64               `json:"maximum,omitempty"`
	MultipleOf       *float64               `json:"multipleOf,omitempty"`
	MinLength        *int                   `json:"minLength,omitempty"`
	MaxLength        *int                   `json:"maxLength,omitempty"`
	UniqueItems      *bool                  `json:"uniqueItems,omitempty"`
	Format           *string                `json:"format,omitempty"`
	Example          *string                `json:"example,omitempty"`
	Regex            *string                `json:"regex,omitempty"`
	Pattern          *string                `json:"pattern,omitempty"`
	Enum             *[]interface{}         `json:"enum,omitempty"`
	Const            *interface{}           `json:"const,omitempty"`
	Contains         *JSONSchame            `json:"contains,omitempty"`
	Items            *interface{}           `json:"items,omitempty"`
	AdditionalItems  *interface{}           `json:"additionalItems,omitempty"`
	MinItems         *int                   `json:"minItems,omitempty"`
	MaxItems         *int                   `json:"maxItems,omitempty"`
	MaxContains      *int                   `json:"maxContains,omitempty"`
	MinContains      *int                   `json:"minContains,omitempty"`
	MaxProperties    *int                   `json:"maxProperties,omitempty"`
	MinProperties    *int                   `json:"minProperties,omitempty"`

	//no standard
	Strict *bool `json:"_strict,omitempty"`
}

func GetSchema

func GetSchema(name string) (*JSONSchame, error)

type ListResponse

type ListResponse struct {
	TotalResults int           `json:"totalResults,omitempty"`
	ItemsPerPage int           `json:"itemsPerPage,omitempty"`
	StartIndex   int           `json:"startIndex,omitempty"`
	Resources    []interface{} `json:"resources,omitempty"`
}
func Search(nameSchema, filter, startIndex, count, sortBy, sortOrder string) (*ListResponse, error)

Jump to

Keyboard shortcuts

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