Documentation ¶
Index ¶
- Constants
- func ConfirmMaxSliceSize[T any](t T, maxSize int) error
- func JSONMarshalIndentWithMax[T any](t T, indentSpaces int) ([]byte, error)
- func JSONMarshalWithMax[T any](t T) ([]byte, error)
- func JSONUnmarshalWithMax[T any](b []byte, t *T) error
- func UnmarshalJob(in []byte) (*models.Job, error)
- func YAMLMarshalWithMax[T any](t T) ([]byte, error)
- func YAMLUnmarshalWithMax[T any](b []byte, t *T) error
- type BinaryMarshaller
- type JSONMarshaller
- type KeyInt
- type KeyString
- type Marshaller
Constants ¶
const MaxNumberOfObjectsToSerialize = 1000
Arbitrarily choosing 1000 jobs to serialize - this is a pretty high
const MaxSerializedStringInput = int(10 * datasize.MB)
Variables ¶
This section is empty.
Functions ¶
func ConfirmMaxSliceSize ¶
func JSONMarshalWithMax ¶
func JSONUnmarshalWithMax ¶
func UnmarshalJob ¶ added in v1.4.0
UnmarshalJob unmarshalled `in` into a models.Job. It returns an error if: - `in` cannot be marshaled to json. - `in` contains an un-settable or unknown field. - `in` cannot be marshaled into a models.Job.
func YAMLMarshalWithMax ¶
func YAMLUnmarshalWithMax ¶
Types ¶
type BinaryMarshaller ¶ added in v1.1.2
type BinaryMarshaller struct{}
BinaryMarshaller uses gob encoding for marshaling.
func NewBinaryMarshaller ¶ added in v1.1.2
func NewBinaryMarshaller() *BinaryMarshaller
NewBinaryMarshaller initializes and returns a new BinaryMarshaller.
func (BinaryMarshaller) Marshal ¶ added in v1.1.2
func (BinaryMarshaller) Marshal(obj interface{}) ([]byte, error)
Marshal converts the given object into a gob-encoded byte slice.
func (BinaryMarshaller) Unmarshal ¶ added in v1.1.2
func (BinaryMarshaller) Unmarshal(data []byte, obj interface{}) error
Unmarshal decodes gob data into the given object.
type JSONMarshaller ¶ added in v1.1.2
type JSONMarshaller struct{}
JSONMarshaller uses JSON encoding for marshaling.
func NewJSONMarshaller ¶ added in v1.1.2
func NewJSONMarshaller() *JSONMarshaller
NewJSONMarshaller initializes and returns a new JSONMarshaller.
func (JSONMarshaller) Marshal ¶ added in v1.1.2
func (JSONMarshaller) Marshal(obj interface{}) ([]byte, error)
Marshal converts the given object into a JSON byte slice.
func (JSONMarshaller) Unmarshal ¶ added in v1.1.2
func (JSONMarshaller) Unmarshal(data []byte, obj interface{}) error
Unmarshal decodes JSON data into the given object and normalizes it if applicable.
type Marshaller ¶ added in v1.1.2
type Marshaller interface { // Marshal converts the given object into a byte slice. Marshal(interface{}) ([]byte, error) // Unmarshal decodes data into the given object, and normalizes it if applicable. Unmarshal([]byte, interface{}) error }
Marshaller defines methods for marshaling and unmarshaling data, and normalizing it if applicable.