Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KnownTypesRegistryInstance = NewKnownTypesRegistry()
KnownTypesRegistryInstance is a default global types registry
Functions ¶
func GetStructType ¶
GetStructType returns reflect.Type of the passed object
Types ¶
type GroupKind ¶
GroupKind specifies a Group and a Kind
func FromString ¶
func (GroupKind) Identifier ¶
Identifier used as uniq key in schema
type KnownTypesRegistry ¶
type KnownTypesRegistry interface {
// AddKnownTypes registers list of types of objects to a Group. Kind of each type will be set as struct name using reflection
AddKnownTypes(g Group, types ...Object)
// AddKnownTypeWithName registers a type an object to a Group and custom defined Kind
AddKnownTypeWithName(gk GroupKind, obj Object)
// NewObject instantiates new object instance of a type registered behind GroupKind
NewObject(gk GroupKind) (Object, error)
// ObjectKind returns GroupKind of an already registered type
ObjectKind(object Object) (*GroupKind, error)
}
func NewKnownTypesRegistry ¶
func NewKnownTypesRegistry() KnownTypesRegistry
NewKnownTypesRegistry returns new empty registry of types
type Object ¶
Object interface must be supported by all message types registered with Scheme. Since objects in a scheme are expected to be marshalled to the wire, the interface an Object must provide to the Scheme allows marshallers to set the kind, and group the object is represented as
Click to show internal directories.
Click to hide internal directories.