record

package
v0.0.0-...-8b9bd6b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONExtension = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONMarshaller

type JSONMarshaller struct {
	Object interface{}
}

func (JSONMarshaller) GetExtension

func (m JSONMarshaller) GetExtension() string

GetExtension return extension for json marshaller

func (JSONMarshaller) Marshal

func (m JSONMarshaller) Marshal() ([]byte, error)

type Marshalable

type Marshalable interface {
	Marshal() ([]byte, error)
	GetExtension() string
}

type MemoryRecord

type MemoryRecord struct {
	Name        string
	At          time.Time
	Data        []byte
	Fingerprint string
}

MemoryRecord Represents records stored in memory

type MemoryRecords

type MemoryRecords []MemoryRecord

func (MemoryRecords) Len

func (r MemoryRecords) Len() int

func (MemoryRecords) Less

func (r MemoryRecords) Less(i, j int) bool

func (MemoryRecords) Swap

func (r MemoryRecords) Swap(i, j int)

type Record

type Record struct {
	Name     string
	Captured time.Time
	Item     Marshalable
	// AlwaysStored marks the record as a priority - it will be always present
	// in the archive regardles of the size limit. Use with caution.
	AlwaysStored bool
}

Record represents a record that will be stored as a file.

func (*Record) GetFilename

func (r *Record) GetFilename() string

GetFilename with extension, if present

func (*Record) Marshal

func (r *Record) Marshal() (content []byte, fingerprint string, err error)

Marshal marshals the item and returns its fingerprint

type ResourceMarshaller

type ResourceMarshaller struct {
	Resource managedFieldsSetter
}

ResourceMarshaller serializes a Kubernetes/OpenShift resource into a JSON format. It performs cleanup of the resource before serialization to reduce resource disk/memory size.

func (ResourceMarshaller) GetExtension

func (m ResourceMarshaller) GetExtension() string

GetExtension returns the file extension that should be used for serialized resources (JSON).

func (ResourceMarshaller) Marshal

func (m ResourceMarshaller) Marshal() ([]byte, error)

Marshal cleans up the resource structure by removing unnecessary fields and converts it into a JSON format using the default serializer.

Jump to

Keyboard shortcuts

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