Documentation ¶
Index ¶
- func GetTypeName(schema proto.Schema) string
- func LookupSchemaForField(schema proto.Schema, path []string) (proto.Schema, error)
- func PrintModel(name string, writer *Formatter, builder fieldsPrinterBuilder, ...) error
- func PrintModelDescription(fieldsPath []string, w io.Writer, schema proto.Schema, ...) error
- func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (schema.GroupVersionResource, []string, error)
- func SplitAndParseResourceRequestWithMatchingPrefix(inResource string, mapper meta.RESTMapper) (gvr schema.GroupVersionResource, fieldsPath []string, err error)
- type Formatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTypeName ¶
GetTypeName returns the type of a schema.
func LookupSchemaForField ¶
LookupSchemaForField looks for the schema of a given path in a base schema.
func PrintModel ¶
func PrintModel(name string, writer *Formatter, builder fieldsPrinterBuilder, schema proto.Schema, gvk schema.GroupVersionKind) error
PrintModel prints the description of a schema in writer.
func PrintModelDescription ¶
func PrintModelDescription(fieldsPath []string, w io.Writer, schema proto.Schema, gvk schema.GroupVersionKind, recursive bool) error
PrintModelDescription prints the description of a specific model or dot path. If recursive, all components nested within the fields of the schema will be printed.
func SplitAndParseResourceRequest ¶
func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (schema.GroupVersionResource, []string, error)
SplitAndParseResourceRequest separates the users input into a model and fields
func SplitAndParseResourceRequestWithMatchingPrefix ¶ added in v0.21.0
func SplitAndParseResourceRequestWithMatchingPrefix(inResource string, mapper meta.RESTMapper) (gvr schema.GroupVersionResource, fieldsPath []string, err error)
SplitAndParseResourceRequestWithMatchingPrefix separates the users input into a model and fields while selecting gvr whose (resource, group) prefix matches the resource
Types ¶
type Formatter ¶
Formatter helps you write with indentation, and can wrap text as needed.
func (Formatter) Indent ¶
Indent creates a new Formatter that will indent the code by that much more.
func (*Formatter) Write ¶
Write writes a string with the indentation set for the Formatter. This is not wrapping text.
func (*Formatter) WriteWrapped ¶
WriteWrapped writes a string with the indentation set for the Formatter, and wraps as needed.