apimachinery

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 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 unversioned.GroupVersion

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

	// Codec is the default codec for serializing output that should use
	// the preferred version.  Use this Codec when writing to
	// disk, a data store that is not dynamically versioned, or in tests.
	// This codec can decode any object that the schema is aware of.
	Codec runtime.Codec

	// 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 unversioned.GroupVersion) (*meta.VersionInterfaces, error)

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

GroupMeta stores the metadata of a group.

func (*GroupMeta) AddVersionInterfaces added in v1.5.0

func (gm *GroupMeta) AddVersionInterfaces(version unversioned.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 added in v1.5.0

func (gm *GroupMeta) DefaultInterfacesFor(version unversioned.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