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 JSONMarshaller
- type KeyInt
- type KeyString
- type Marshaller
Constants ¶
View Source
const MaxNumberOfObjectsToSerialize = 1000
Arbitrarily choosing 1000 jobs to serialize - this is a pretty high
View Source
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 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.
Click to show internal directories.
Click to hide internal directories.