documents

package
v1.2.80 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Id        string           `json:"id" avro:"id"`
	Version   versions.Version `json:"version" avro:"version"`
	Endpoints Endpoints        `json:"endpoints" avro:"endpoints"`
}

func (*Document) Add

func (document *Document) Add(endpoint Endpoint)

func (*Document) Get

func (document *Document) Get(name []byte) (v Endpoint)

type Documents

type Documents []Document

Documents version based

func (Documents) Add

func (documents Documents) Add(endpoint Endpoint) Documents

func (Documents) Latest added in v1.1.1

func (documents Documents) Latest() (document Document)

func (Documents) Len

func (documents Documents) Len() int

func (Documents) Less

func (documents Documents) Less(i, j int) bool

func (Documents) Swap

func (documents Documents) Swap(i, j int)

func (Documents) Version added in v1.1.1

func (documents Documents) Version(ver versions.Version) (document Document, has bool)

type Element

type Element struct {
	Nil         bool       `json:"non" avro:"nil"`
	Path        string     `json:"path,omitempty" avro:"path"`
	Name        string     `json:"name,omitempty" avro:"name"`
	Title       string     `json:"title,omitempty" avro:"title"`
	Description string     `json:"description,omitempty" avro:"description"`
	Type        string     `json:"type,omitempty" avro:"type"`
	Format      string     `json:"format,omitempty" avro:"format"`
	Enums       []string   `json:"enums,omitempty" avro:"enums"`
	Required    bool       `json:"required,omitempty" avro:"required"`
	Validation  Validation `json:"validation,omitempty" avro:"validation"`
	Properties  Properties `json:"properties,omitempty" avro:"properties"`
	Additional  bool       `json:"additional,omitempty" avro:"additional"`
	Deprecated  bool       `json:"deprecated,omitempty" avro:"deprecated"`
}

func Any

func Any() Element

func Array

func Array(item Element) Element

func Bool

func Bool() Element

func Bytes

func Bytes() Element

func Complex128

func Complex128() Element

func Complex64

func Complex64() Element

func Date

func Date() Element

func DateTime

func DateTime() Element

func Duration

func Duration() Element

func Empty

func Empty() Element

func Float32

func Float32() Element

func Float64

func Float64() Element

func Ident

func Ident(path string, name string, target Element) Element

func Int

func Int() Element

func Int32

func Int32() Element

func Int64

func Int64() Element

func JsonRaw

func JsonRaw() Element

func Map

func Map(value Element) Element

func NewElement

func NewElement(path string, name string, typ string, format string, title string, description string) Element

func Nil

func Nil() Element

func Password

func Password() Element

func Ref

func Ref(path string, name string) Element

func String

func String() Element

func Struct

func Struct(path string, name string) Element

func Time

func Time() Element

func Uint

func Uint() Element

func Uint32

func Uint32() Element

func Uint64

func Uint64() Element

func Uint8

func Uint8() Element

func Unknown

func Unknown() Element

func (Element) AddEnum

func (element Element) AddEnum(v ...string) Element

func (Element) AddProperty

func (element Element) AddProperty(name string, prop Element) Element

func (Element) AsDeprecated

func (element Element) AsDeprecated() Element

func (Element) AsPassword

func (element Element) AsPassword() Element

func (Element) AsRequired

func (element Element) AsRequired() Element

func (Element) Exist

func (element Element) Exist() bool

func (Element) GetItem added in v1.1.1

func (element Element) GetItem() (v Element, has bool)

func (Element) IsAdditional added in v1.1.1

func (element Element) IsAdditional() (ok bool)

func (Element) IsAny added in v1.2.0

func (element Element) IsAny() (ok bool)

func (Element) IsArray added in v1.1.1

func (element Element) IsArray() (ok bool)

func (Element) IsBuiltin added in v1.1.1

func (element Element) IsBuiltin() (ok bool)

func (Element) IsEmpty added in v1.1.1

func (element Element) IsEmpty() (ok bool)

func (Element) IsObject added in v1.1.1

func (element Element) IsObject() (ok bool)

func (Element) IsRef added in v1.1.1

func (element Element) IsRef() (ok bool)

func (Element) Key

func (element Element) Key() (v string)

func (Element) SetDescription

func (element Element) SetDescription(description string) Element

func (Element) SetFormat

func (element Element) SetFormat(format string) Element

func (Element) SetName

func (element Element) SetName(name string) Element

func (Element) SetPath

func (element Element) SetPath(path string) Element

func (Element) SetTitle

func (element Element) SetTitle(title string) Element

func (Element) SetValidation

func (element Element) SetValidation(validation Validation) Element

type ElementValidation

type ElementValidation struct {
	Name string            `json:"name,omitempty" avro:"name"`
	I18n map[string]string `json:"i18n,omitempty" avro:"i18N"`
}

func NewElementValidation

func NewElementValidation(name string, i18ns ...string) (v *ElementValidation)

type Elements

type Elements []Element

func (Elements) Add

func (elements Elements) Add(element Element) Elements

func (Elements) Len

func (elements Elements) Len() int

func (Elements) Less

func (elements Elements) Less(i, j int) bool

func (Elements) Swap

func (elements Elements) Swap(i, j int)

type Endpoint

type Endpoint struct {
	Id          []string         `json:"id,omitempty" avro:"id"`
	Version     versions.Version `json:"version" avro:"version"`
	Name        string           `json:"name" avro:"name"`
	Title       string           `json:"title" avro:"title"`
	Description string           `json:"description" avro:"description"`
	Internal    bool             `json:"internal" avro:"internal"`
	Functions   Fns              `json:"functions" avro:"functions"`
	Elements    Elements         `json:"elements" avro:"elements"`
}

func New

func New(name string, title string, description string) Endpoint

func (*Endpoint) AddFn

func (endpoint *Endpoint) AddFn(fn Fn)

func (*Endpoint) Defined

func (endpoint *Endpoint) Defined() bool

func (*Endpoint) SetInternal added in v1.2.0

func (endpoint *Endpoint) SetInternal()

type Endpoints

type Endpoints []Endpoint

func (Endpoints) Len

func (endpoints Endpoints) Len() int

func (Endpoints) Less

func (endpoints Endpoints) Less(i, j int) bool

func (Endpoints) Swap

func (endpoints Endpoints) Swap(i, j int)

type Error

type Error struct {
	Name         string            `json:"name" avro:"name"`
	Descriptions ErrorDescriptions `json:"descriptions" avro:"descriptions"`
}

func NewError

func NewError(name string) Error

func (Error) AddNamedDescription

func (err Error) AddNamedDescription(name string, value string) Error

type ErrorDescription

type ErrorDescription struct {
	Name  string `json:"name" avro:"name"`
	Value string `json:"value" avro:"value"`
}

type ErrorDescriptions

type ErrorDescriptions []ErrorDescription

func (ErrorDescriptions) Add

func (pp ErrorDescriptions) Add(name string, value string) ErrorDescriptions

func (ErrorDescriptions) Get

func (pp ErrorDescriptions) Get(name string) (v string, has bool)

func (ErrorDescriptions) Len

func (pp ErrorDescriptions) Len() int

func (ErrorDescriptions) Less

func (pp ErrorDescriptions) Less(i, j int) bool

func (ErrorDescriptions) Swap

func (pp ErrorDescriptions) Swap(i, j int)

type Errors

type Errors []Error

Errors use @errors @errors >>>

name1
zh: chinese
en: english
name2
zh: chinese
en: english

<<<

func NewErrors

func NewErrors(src string) Errors

func (Errors) Add

func (pp Errors) Add(e Error) Errors

func (Errors) Len

func (pp Errors) Len() int

func (Errors) Less

func (pp Errors) Less(i, j int) bool

func (Errors) Swap

func (pp Errors) Swap(i, j int)

type Fn

type Fn struct {
	Name          string  `json:"name,omitempty" avro:"name"`
	Title         string  `json:"title,omitempty" avro:"title"`
	Description   string  `json:"description,omitempty" avro:"description"`
	Deprecated    bool    `json:"deprecated,omitempty" avro:"deprecated"`
	Internal      bool    `json:"internal,omitempty" avro:"internal"`
	Readonly      bool    `json:"readonly,omitempty" avro:"readonly"`
	Authorization bool    `json:"authorization,omitempty" avro:"authorization"`
	Permission    bool    `json:"permission,omitempty" avro:"permission"`
	Param         Element `json:"argument,omitempty" avro:"param"`
	Result        Element `json:"result,omitempty" avro:"result"`
	Errors        Errors  `json:"errors,omitempty" avro:"errors"`
}

func NewFn

func NewFn(name string) Fn

func (Fn) AddError

func (fn Fn) AddError(err Error) Fn

func (Fn) SetAuthorization

func (fn Fn) SetAuthorization(authorization bool) Fn

func (Fn) SetDeprecated

func (fn Fn) SetDeprecated(deprecated bool) Fn

func (Fn) SetErrors

func (fn Fn) SetErrors(err string) Fn

func (Fn) SetInfo

func (fn Fn) SetInfo(title string, description string) Fn

func (Fn) SetInternal

func (fn Fn) SetInternal(internal bool) Fn

func (Fn) SetParam

func (fn Fn) SetParam(param Element) Fn

func (Fn) SetPermission

func (fn Fn) SetPermission(permission bool) Fn

func (Fn) SetReadonly

func (fn Fn) SetReadonly(readonly bool) Fn

func (Fn) SetResult

func (fn Fn) SetResult(result Element) Fn

type Fns

type Fns []Fn

func (Fns) Add

func (pp Fns) Add(fn Fn) Fns

func (Fns) Len

func (pp Fns) Len() int

func (Fns) Less

func (pp Fns) Less(i, j int) bool

func (Fns) Swap

func (pp Fns) Swap(i, j int)

type I18n

type I18n struct {
	Name  string `json:"name,omitempty" avro:"name"`
	Value string `json:"value,omitempty" avro:"value"`
}

type I18ns

type I18ns []I18n

func (I18ns) Add

func (pp I18ns) Add(name string, value string) I18ns

func (I18ns) Get

func (pp I18ns) Get(name string) (p string, has bool)

func (I18ns) Len

func (pp I18ns) Len() int

func (I18ns) Less

func (pp I18ns) Less(i, j int) bool

func (I18ns) Swap

func (pp I18ns) Swap(i, j int)

type Properties

type Properties []Property

func (Properties) Add

func (pp Properties) Add(name string, element Element) Properties

func (Properties) Get

func (pp Properties) Get(name string) (p Property, has bool)

func (Properties) Len

func (pp Properties) Len() int

func (Properties) Less

func (pp Properties) Less(i, j int) bool

func (Properties) Swap

func (pp Properties) Swap(i, j int)

type Property

type Property struct {
	Name    string  `json:"name" avro:"name"`
	Element Element `json:"element" avro:"element"`
}

type Validation

type Validation struct {
	Enable bool   `json:"enable,omitempty" avro:"enable"`
	Name   string `json:"name,omitempty" avro:"name"`
	I18ns  I18ns  `json:"i18ns,omitempty" avro:"i18Ns"`
}

func NewValidation

func NewValidation(name string) Validation

func (Validation) AddI18n

func (validation Validation) AddI18n(name string, value string) Validation

Jump to

Keyboard shortcuts

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