types

package
v0.0.0-...-ae6f447 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicType

type BasicType struct {
	Desc string
	Name string
	Type string
}

type Components

type Components struct {
	ContentDescriptors    map[string]*ContentDescriptor `json:"contentDescriptors"`
	Schemas               map[string]spec.Schema        `json:"schemas"`
	Examples              map[string]Example            `json:"examples"`
	Links                 map[string]Link               `json:"links"`
	Errors                map[string]Error              `json:"errors"`
	ExamplePairingObjects map[string]ExamplePairing     `json:"examplePairingObjects"`
	Tags                  map[string]Tag                `json:"tags"`
}

type Contact

type Contact struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	Email string `json:"email"`
}

type Content

type Content struct {
	Name        string      `json:"name"`
	Summary     string      `json:"summary"`
	Description string      `json:"description"`
	Required    bool        `json:"required"`
	Deprecated  bool        `json:"deprecated"`
	Schema      spec.Schema `json:"schema"`
}

type ContentDescriptor

type ContentDescriptor struct {
	Content
}

func (*ContentDescriptor) UnmarshalJSON

func (cd *ContentDescriptor) UnmarshalJSON(data []byte) error

type Error

type Error struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

https://www.jsonrpc.org/specification#error_object

type Example

type Example struct {
	Name          string      `json:"name"`
	Summary       string      `json:"summary"`
	Description   string      `json:"description"`
	Value         interface{} `json:"value"`
	ExternalValue string      `json:"externalValue"`
}

type ExamplePairing

type ExamplePairing struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Summary     string    `json:"summary"`
	Params      []Example `json:"params"`
	Result      Example   `json:"result"`
}

type ExternalDocs

type ExternalDocs struct {
	Description string `json:"description"`
	URL         string `json:"url"`
}

type FieldMap

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

func NewFieldMap

func NewFieldMap() *FieldMap

func (*FieldMap) Get

func (fm *FieldMap) Get(key string) BasicType

func (*FieldMap) GetKeys

func (fm *FieldMap) GetKeys() []string

func (*FieldMap) Set

func (fm *FieldMap) Set(key string, value BasicType)

type Info

type Info struct {
	Title          string  `json:"title"`
	Description    string  `json:"description"`
	TermsOfService string  `json:"termsOfService"`
	Contact        Contact `json:"contact"`
	License        License `json:"license"`
	Version        string  `json:"version"`
}

type License

type License struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}
type Link struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Summary     string                 `json:"summary"`
	Method      string                 `json:"method"`
	Params      map[string]interface{} `json:"params"`
	Server      Server                 `json:"server"`
}

type Method

type Method struct {
	Name           string               `json:"name"`
	Tags           []Tag                `json:"tags"`
	Summary        string               `json:"summary"`
	Description    string               `json:"description"`
	ExternalDocs   ExternalDocs         `json:"externalDocs"`
	Params         []*ContentDescriptor `json:"params"`
	Result         *ContentDescriptor   `json:"result"`
	Deprecated     bool                 `json:"deprecated"`
	Servers        []Server             `json:"servers"`
	Errors         []Error              `json:"errors"`
	Links          []Link               `json:"links"`
	ParamStructure string               `json:"paramStructure"`
	Examples       []ExamplePairing     `json:"examples"`
}

type ObjectMap

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

func NewObjectMap

func NewObjectMap() *ObjectMap

func (*ObjectMap) Get

func (om *ObjectMap) Get(key string) *FieldMap

func (*ObjectMap) GetKeys

func (om *ObjectMap) GetKeys() []string

func (*ObjectMap) Set

func (om *ObjectMap) Set(key string, value BasicType)

type OpenRPCSpec1

type OpenRPCSpec1 struct {
	OpenRPC      string       `json:"openrpc"`
	Info         Info         `json:"info"`
	Servers      []Server     `json:"servers"`
	Methods      []Method     `json:"methods"`
	Components   Components   `json:"components"`
	ExternalDocs ExternalDocs `json:"externalDocs"`

	Objects *ObjectMap `json:"-"`
}

func NewOpenRPCSpec1

func NewOpenRPCSpec1() *OpenRPCSpec1

type Server

type Server struct {
	Name        string                    `json:"name"`
	URL         string                    `json:"url"`
	Summary     string                    `json:"summary"`
	Description string                    `json:"description"`
	Variables   map[string]ServerVariable `json:"variables"`
}

type ServerVariable

type ServerVariable struct {
	Enum        []string `json:"enum"`
	Default     string   `json:"default"`
	Description string   `json:"description"`
}

type Tag

type Tag struct {
	Name         string       `json:"name"`
	Summary      string       `json:"summary"`
	Description  string       `json:"description"`
	ExternalDocs ExternalDocs `json:"externalDocs"`
}

Jump to

Keyboard shortcuts

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