Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface { // Decode attempts to deserialize the provided bytes into the provided object. Decode(data []byte, defaults *string, into Object) (Object, *string, error) }
Decoder knows how to decode an object from a stream.
type Encoder ¶
type Encoder interface { // Encode writes a set of objects to a stream. Encode(obj Object, w io.Writer) error }
Encoder knows how to encode an object into a stream.
type Framer ¶
type Framer interface { // NewFrameReader returns a Reader that wraps the provided Reader, NewFrameReader(r io.ReadCloser) io.ReadCloser // NewFrameWriter returns a Writer that wraps the provided Writer. NewFrameWriter(w io.Writer) io.Writer }
Framer knows how to wrap and unwrap a stream of data.
type Object ¶
type Object interface { // GetObjectKind returns the kind of object, as represented by the ObjectKind GetObjectKind() schema.ObjectKind // DeepCopyObject returns a copy of the object. DeepCopyObject() Object }
Object is an object that has an ObjectKind.
func UseOrCreateObject ¶
func UseOrCreateObject(t ObjectTyper, c ObjectCreator, kind string, obj Object) (Object, error)
type ObjectCreator ¶
type ObjectCreator interface { // New returns a new object of the provided kind. New(kind string) (out Object, err error) }
ObjectCreator knows how to create an object.
type ObjectTyper ¶
type ObjectTyper interface { // ObjectKind returns the kind of the provided object. ObjectKind(Object) (string, error) // Recognizes returns true if the provided kind is known to this typer. Recognizes(kind string) bool }
ObjectTyper knows how to get the kind of an object.
type Scheme ¶
type Scheme struct {
// contains filtered or unexported fields
}
func (*Scheme) AddKnownTypeWithName ¶
func (*Scheme) AllKnownTypes ¶
AllKnownTypes returns the all known types.
func (*Scheme) Recognizes ¶
type SchemeBuilder ¶
func NewSchemeBuilder ¶
func NewSchemeBuilder(funcs ...func(*Scheme) error) SchemeBuilder
NewSchemeBuilder calls Register for you.
func (*SchemeBuilder) AddToScheme ¶
func (sb *SchemeBuilder) AddToScheme(s *Scheme) error
AddToScheme applies all the stored functions to the scheme. A non-nil error indicates that one function failed and the attempt was abandoned.
func (*SchemeBuilder) Register ¶
func (sb *SchemeBuilder) Register(funcs ...func(*Scheme) error)
Register adds a scheme setup function to the list.
type Serializer ¶
type Serializer interface { // Encoder knows how to serialize an object. Encoder // Decoder knows how to deserialize an object. Decoder }
Serializer knows how to serialize and deserialize objects.