apimachinery

package
v0.0.0-...-d94079d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package apimachinery contains the generic API machinery code that is common to both server and clients. This package should never import specific API objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupMeta

type GroupMeta struct {
	// GroupVersion represents the preferred version of the group.
	GroupVersion schema.GroupVersion

	// GroupVersions is Group + all versions in that group.
	GroupVersions []schema.GroupVersion

	// SelfLinker can set or get the SelfLink field of all API types.
	// TODO: when versioning changes, make this part of each API definition.
	// TODO(lavalamp): Combine SelfLinker & ResourceVersioner interfaces, force all uses
	// to go through the InterfacesFor method below.
	SelfLinker runtime.SelfLinker

	// RESTMapper provides the default mapping between REST paths and the objects declared in api.Scheme and all known
	// versions.
	RESTMapper meta.RESTMapper

	// InterfacesFor returns the default Codec and ResourceVersioner for a given version
	// string, or an error if the version is not known.
	// TODO: make this stop being a func pointer and always use the default
	// function provided below once every place that populates this field has been changed.
	InterfacesFor func(version schema.GroupVersion) (*meta.VersionInterfaces, error)

	// InterfacesByVersion stores the per-version interfaces.
	InterfacesByVersion map[schema.GroupVersion]*meta.VersionInterfaces
}

GroupMeta stores the metadata of a group.

func (*GroupMeta) AddVersionInterfaces

func (gm *GroupMeta) AddVersionInterfaces(version schema.GroupVersion, interfaces *meta.VersionInterfaces) error

AddVersionInterfaces adds the given version to the group. Only call during init, after that GroupMeta objects should be immutable. Not thread safe. (If you use this, be sure to set .InterfacesFor = .DefaultInterfacesFor) TODO: remove the "Interfaces" suffix and make this also maintain the .GroupVersions member.

func (*GroupMeta) DefaultInterfacesFor

func (gm *GroupMeta) DefaultInterfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error)

DefaultInterfacesFor returns the default Codec and ResourceVersioner for a given version string, or an error if the version is not known. TODO: Remove the "Default" prefix.

Directories

Path Synopsis
Package announced contains tools for announcing API group factories.
Package announced contains tools for announcing API group factories.
Package to keep track of API Versions that can be registered and are enabled in api.Scheme.
Package to keep track of API Versions that can be registered and are enabled in api.Scheme.

Jump to

Keyboard shortcuts

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