types

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 7 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 Identifier

func Identifier(t *Type) string

Identifier generates the non-unique identifier for the type, disregarding it being a e.g. a list or pointer, and will thus be the same for both *Foo and Foo. Use Type's UID for a unique identifier.

Types

type Field

type Field struct {
	Name     string
	Embedded bool // Embedded struct in Go typing
	Inlined  bool // Inlined struct in serialization
	Doc      string
	Markers  markers.MarkerValues
	Type     *Type
}

Field describes a field in a struct.

type Fields

type Fields []*Field

type GroupVersionDetails

type GroupVersionDetails struct {
	schema.GroupVersion
	Doc   string
	Kinds []string
	Types TypeMap
}

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
	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 {
	UID            string                   `json:"uid"`
	Name           string                   `json:"name"`
	Package        string                   `json:"package"`
	Doc            string                   `json:"doc"`
	Markers        markers.MarkerValues     `json:"markers"`
	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         Fields                   `json:"fields"`         // for structs
	References     []*Type                  `json:"-"`              // other types that refer to this type
}

Type describes a declared type

func (*Type) ContainsInlinedTypes

func (t *Type) ContainsInlinedTypes() bool

func (*Type) IsAlias

func (t *Type) IsAlias() bool

func (*Type) IsBasic

func (t *Type) IsBasic() bool

func (*Type) Members

func (t *Type) Members() Fields

func (*Type) SortedReferences

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

func (*Type) String

func (t *Type) String() string

type TypeMap

type TypeMap map[string]*Type

TypeMap is a map of Type elements

func (TypeMap) InlineTypes

func (types TypeMap) InlineTypes(propagateReference func(original *Type, additional *Type))

Jump to

Keyboard shortcuts

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