types

package
v10.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 0 Imported by: 170

Documentation

Overview

Wrappers for Avro primitive types implementing the methods required by GADGT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean struct {
	Target *bool
}

func (Boolean) AppendArray

func (b Boolean) AppendArray() Field

func (Boolean) AppendMap

func (b Boolean) AppendMap(key string) Field

func (Boolean) Finalize

func (b Boolean) Finalize()

func (Boolean) Get

func (b Boolean) Get(i int) Field

func (Boolean) HintSize

func (b Boolean) HintSize(int)

func (Boolean) NullField

func (b Boolean) NullField(int)

func (Boolean) SetBoolean

func (b Boolean) SetBoolean(v bool)

func (Boolean) SetBytes

func (b Boolean) SetBytes(v []byte)

func (Boolean) SetDefault

func (b Boolean) SetDefault(i int)

func (Boolean) SetDouble

func (b Boolean) SetDouble(v float64)

func (Boolean) SetFloat

func (b Boolean) SetFloat(v float32)

func (Boolean) SetInt

func (b Boolean) SetInt(v int32)

func (Boolean) SetLong

func (b Boolean) SetLong(v int64)

func (Boolean) SetString

func (b Boolean) SetString(v string)

func (Boolean) SetUnionElem

func (b Boolean) SetUnionElem(v int64)

type Double

type Double struct {
	Target *float64
}

func (Double) AppendArray

func (b Double) AppendArray() Field

func (Double) AppendMap

func (b Double) AppendMap(key string) Field

func (Double) Finalize

func (b Double) Finalize()

func (Double) Get

func (b Double) Get(i int) Field

func (Double) HintSize

func (b Double) HintSize(int)

func (Double) NullField

func (b Double) NullField(int)

func (Double) SetBoolean

func (b Double) SetBoolean(v bool)

func (Double) SetBytes

func (b Double) SetBytes(v []byte)

func (Double) SetDefault

func (b Double) SetDefault(i int)

func (Double) SetDouble

func (b Double) SetDouble(v float64)

func (Double) SetFloat

func (b Double) SetFloat(v float32)

func (Double) SetInt

func (b Double) SetInt(v int32)

func (Double) SetLong

func (b Double) SetLong(v int64)

func (Double) SetString

func (b Double) SetString(v string)

func (Double) SetUnionElem

func (b Double) SetUnionElem(v int64)

type Field

type Field interface {
	// Assign a primitive field
	SetBoolean(v bool)
	SetInt(v int32)
	SetLong(v int64)
	SetFloat(v float32)
	SetDouble(v float64)
	SetBytes(v []byte)
	SetString(v string)

	// Get a nested field
	Get(i int) Field
	// Set the default value for a given field
	SetDefault(i int)

	// Append a new value to a map or array and enter it
	AppendMap(key string) Field
	AppendArray() Field

	// Set the target field to null
	NullField(t int)

	// Hint at the final size of a map or array, for performance
	HintSize(s int)

	// Finalize a field if necessary
	Finalize()
}

The interface neeed by GADGT to enter and set fields on a type Most types only need to implement a subset

type Float

type Float struct {
	Target *float32
}

func (Float) AppendArray

func (b Float) AppendArray() Field

func (Float) AppendMap

func (b Float) AppendMap(key string) Field

func (Float) Finalize

func (b Float) Finalize()

func (Float) Get

func (b Float) Get(i int) Field

func (Float) HintSize

func (b Float) HintSize(int)

func (Float) NullField

func (b Float) NullField(int)

func (Float) SetBoolean

func (b Float) SetBoolean(v bool)

func (Float) SetBytes

func (b Float) SetBytes(v []byte)

func (Float) SetDefault

func (b Float) SetDefault(i int)

func (Float) SetDouble

func (b Float) SetDouble(v float64)

func (Float) SetFloat

func (b Float) SetFloat(v float32)

func (Float) SetInt

func (b Float) SetInt(v int32)

func (Float) SetLong

func (b Float) SetLong(v int64)

func (Float) SetString

func (b Float) SetString(v string)

func (Float) SetUnionElem

func (b Float) SetUnionElem(v int64)

type Int

type Int struct {
	Target *int32
}

func (Int) AppendArray

func (b Int) AppendArray() Field

func (Int) AppendMap

func (b Int) AppendMap(key string) Field

func (Int) Finalize

func (b Int) Finalize()

func (Int) Get

func (b Int) Get(i int) Field

func (Int) HintSize

func (b Int) HintSize(int)

func (Int) NullField

func (b Int) NullField(int)

func (Int) SetBoolean

func (b Int) SetBoolean(v bool)

func (Int) SetBytes

func (b Int) SetBytes(v []byte)

func (Int) SetDefault

func (b Int) SetDefault(i int)

func (Int) SetDouble

func (b Int) SetDouble(v float64)

func (Int) SetFloat

func (b Int) SetFloat(v float32)

func (Int) SetInt

func (b Int) SetInt(v int32)

func (Int) SetLong

func (b Int) SetLong(v int64)

func (Int) SetString

func (b Int) SetString(v string)

func (Int) SetUnionElem

func (b Int) SetUnionElem(v int64)

type Long

type Long struct {
	Target *int64
}

func (Long) AppendArray

func (b Long) AppendArray() Field

func (Long) AppendMap

func (b Long) AppendMap(key string) Field

func (Long) Finalize

func (b Long) Finalize()

func (Long) Get

func (b Long) Get(i int) Field

func (Long) HintSize

func (b Long) HintSize(int)

func (Long) NullField

func (b Long) NullField(int)

func (Long) SetBoolean

func (b Long) SetBoolean(v bool)

func (Long) SetBytes

func (b Long) SetBytes(v []byte)

func (Long) SetDefault

func (b Long) SetDefault(i int)

func (Long) SetDouble

func (b Long) SetDouble(v float64)

func (Long) SetFloat

func (b Long) SetFloat(v float32)

func (Long) SetInt

func (b Long) SetInt(v int32)

func (Long) SetLong

func (b Long) SetLong(v int64)

func (Long) SetString

func (b Long) SetString(v string)

func (Long) SetUnionElem

func (b Long) SetUnionElem(v int64)

type NullVal

type NullVal struct{}

func (*NullVal) AppendArray

func (b *NullVal) AppendArray() Field

func (*NullVal) AppendMap

func (b *NullVal) AppendMap(key string) Field

func (*NullVal) Finalize

func (b *NullVal) Finalize()

func (*NullVal) Get

func (b *NullVal) Get(i int) Field

func (*NullVal) HintSize

func (b *NullVal) HintSize(int)

func (*NullVal) NullField

func (b *NullVal) NullField(int)

func (*NullVal) SetBoolean

func (b *NullVal) SetBoolean(v bool)

func (*NullVal) SetBytes

func (b *NullVal) SetBytes(v []byte)

func (*NullVal) SetDefault

func (b *NullVal) SetDefault(i int)

func (*NullVal) SetDouble

func (b *NullVal) SetDouble(v float64)

func (*NullVal) SetFloat

func (b *NullVal) SetFloat(v float32)

func (*NullVal) SetInt

func (b *NullVal) SetInt(v int32)

func (*NullVal) SetLong

func (b *NullVal) SetLong(v int64)

func (*NullVal) SetString

func (b *NullVal) SetString(v string)

func (*NullVal) SetUnionElem

func (b *NullVal) SetUnionElem(v int64)

type Record

type Record struct {
	Target Field
}

func (Record) AppendArray

func (b Record) AppendArray() Field

func (Record) AppendMap

func (b Record) AppendMap(key string) Field

func (Record) Finalize

func (b Record) Finalize()

func (Record) Get

func (b Record) Get(i int) Field

func (Record) HintSize

func (b Record) HintSize(v int)

func (Record) NullField

func (b Record) NullField(v int)

func (Record) SetBoolean

func (b Record) SetBoolean(v bool)

func (Record) SetBytes

func (b Record) SetBytes(v []byte)

func (Record) SetDefault

func (b Record) SetDefault(i int)

func (Record) SetDouble

func (b Record) SetDouble(v float64)

func (Record) SetFloat

func (b Record) SetFloat(v float32)

func (Record) SetInt

func (b Record) SetInt(v int32)

func (Record) SetLong

func (b Record) SetLong(v int64)

func (Record) SetString

func (b Record) SetString(v string)

type String

type String struct {
	Target *string
}

func (String) AppendArray

func (b String) AppendArray() Field

func (String) AppendMap

func (b String) AppendMap(key string) Field

func (String) Finalize

func (b String) Finalize()

func (String) Get

func (b String) Get(i int) Field

func (String) HintSize

func (b String) HintSize(int)

func (String) NullField

func (b String) NullField(int)

func (String) SetBoolean

func (b String) SetBoolean(v bool)

func (String) SetBytes

func (b String) SetBytes(v []byte)

func (String) SetDefault

func (b String) SetDefault(i int)

func (String) SetDouble

func (b String) SetDouble(v float64)

func (String) SetFloat

func (b String) SetFloat(v float32)

func (String) SetInt

func (b String) SetInt(v int32)

func (String) SetLong

func (b String) SetLong(v int64)

func (String) SetString

func (b String) SetString(v string)

func (String) SetUnionElem

func (b String) SetUnionElem(v int64)

Jump to

Keyboard shortcuts

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