types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Licensed to Elasticsearch B.V. under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Elasticsearch B.V. licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(t *Type) string

Key generates the unique name for the give type.

Types

type Field

type Field struct {
	Name     string
	Embedded bool
	Doc      string
	Type     *Type
}

Field describes a field in a struct.

type GroupVersionDetails

type GroupVersionDetails struct {
	schema.GroupVersion
	Doc   string
	Kinds []string
	Types map[string]*Type
}

GroupVersionDetails encapsulates details about a discovered API group.

func (GroupVersionDetails) GroupVersionString

func (gvd GroupVersionDetails) GroupVersionString() string

func (GroupVersionDetails) SortedKinds

func (gvd GroupVersionDetails) SortedKinds() []string

func (GroupVersionDetails) SortedTypes

func (gvd GroupVersionDetails) SortedTypes() []*Type

func (GroupVersionDetails) TypeForKind

func (gvd GroupVersionDetails) TypeForKind(k string) *Type

type Kind

type Kind int

Kind describes the kind of the type (alias, array, etc.)

const (
	AliasKind Kind = iota
	ArrayKind
	BasicKind
	InterfaceKind
	MapKind
	PointerKind
	SliceKind
	StructKind
	UnknownKind
	UnsupportedKind
)

func (Kind) MarshalJSON

func (k Kind) MarshalJSON() ([]byte, error)

func (*Kind) UnmarshalJSON

func (k *Kind) UnmarshalJSON(b []byte) error

type Type

type Type struct {
	Name           string                   `json:"name"`
	Package        string                   `json:"package"`
	Doc            string                   `json:"doc"`
	GVK            *schema.GroupVersionKind `json:"gvk"`
	Kind           Kind                     `json:"kind"`
	Imported       bool                     `json:"imported"`
	UnderlyingType *Type                    `json:"underlyingType"` // for aliases, slices and pointers
	KeyType        *Type                    `json:"keyType"`        // for maps
	ValueType      *Type                    `json:"valueType"`      // for maps
	Fields         []*Field                 `json:"fields"`         // for structs
	References     []*Type                  `json:"-"`              // other types that refer to this type
}

Type describes a declared type

func (*Type) IsAlias

func (t *Type) IsAlias() bool

func (*Type) IsBasic

func (t *Type) IsBasic() bool

func (*Type) Members

func (t *Type) Members() []*Field

func (*Type) SortedReferences

func (t *Type) SortedReferences() []*Type

func (*Type) String

func (t *Type) String() string

Jump to

Keyboard shortcuts

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