swagger

package
v0.0.0-...-3832929 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDLoader

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

func (*CRDLoader) Load

func (c *CRDLoader) Load(manifest []byte) (Definitions, error)

type Definitions

type Definitions map[string]*Schema

func Load

func Load(loader Loader, url string) (Definitions, error)

func (Definitions) Filter

func (ds Definitions) Filter(f func(k string, v Schema) bool) Definitions

func (Definitions) Sub

func (ds Definitions) Sub(exp string) Definitions

type Loader

type Loader interface {
	Load([]byte) (Definitions, error)
}

type Schema

type Schema struct {
	// general
	Type Type   `json:"type"`
	Desc string `json:"description"`

	// type: object
	Props map[string]*Schema `json:"properties"`
	// type: array
	Items *Schema `json:"items"`

	// incomplete: reference
	DollarRef   *string `json:"$ref"`
	ResolvedRef string

	// Cluster or Namespaced scope, ignored if unset
	Scope *string

	// vendor extensions
	XGvk []XGvk `json:"x-kubernetes-group-version-kind"`
}

Schema is a general object definition

func (Schema) GroupVersionKind

func (s Schema) GroupVersionKind() (*XGvk, bool)

func (Schema) Ref

func (s Schema) Ref() string

type SwaggerLoader

type SwaggerLoader struct {
	Definitions Definitions `json:"definitions"`
	// contains filtered or unexported fields
}

func (*SwaggerLoader) Load

func (s *SwaggerLoader) Load(data []byte) (Definitions, error)

type Type

type Type string

swagger types

const (
	TypeString Type = "string"
	TypeInt    Type = "integer"
	TypeBool   Type = "boolean"
	TypeObject Type = "object"
	TypeArray  Type = "array"
)

type XGvk

type XGvk struct {
	Group   string
	Kind    string
	Version string
}

Jump to

Keyboard shortcuts

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