models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewCDCRecord = pool.NewCDCRecord

NewCDCRecord creates a new record for Change Data Capture

View Source
var NewRecord = pool.NewRecord

NewRecord creates a new record with the given source and data

View Source
var NewRecordFromPool = pool.NewRecordFromPool

NewRecordFromPool creates a new record using pooled resources

View Source
var NewStreamingRecord = pool.NewStreamingRecord

NewStreamingRecord creates a new record for streaming

Functions

This section is empty.

Types

type Field

type Field struct {
	// Name of the field
	Name string `json:"name"`

	// Type of the field (string, integer, float, boolean, object, array)
	Type string `json:"type"`

	// Description of the field (optional)
	Description string `json:"description,omitempty"`

	// Required indicates if the field is required
	Required bool `json:"required"`

	// Fields for nested objects
	Fields []Field `json:"fields,omitempty"`
}

Field represents a single field in the schema

type IRecord

type IRecord interface {
	ToModelsRecord() *Record
	Release()
}

IRecord interface for backward compatibility

func AsIRecord

func AsIRecord(r *Record) IRecord

AsIRecord converts a Record to IRecord interface for backward compatibility

type Record

type Record = pool.Record

Re-export unified pool types for backward compatibility

type RecordBatch

type RecordBatch struct {
	Records []*Record
	// contains filtered or unexported fields
}

RecordBatch represents a batch of records

func NewRecordBatch

func NewRecordBatch(capacity int) *RecordBatch

NewRecordBatch creates a new record batch

func (*RecordBatch) AddRecord

func (rb *RecordBatch) AddRecord(r *Record)

AddRecord adds a record to the batch

func (*RecordBatch) Reset

func (rb *RecordBatch) Reset()

Reset resets the batch for reuse

func (*RecordBatch) Size

func (rb *RecordBatch) Size() int

Size returns the number of records in the batch

type RecordMetadata

type RecordMetadata = pool.RecordMetadata

type RecordWrapper

type RecordWrapper struct {
	// contains filtered or unexported fields
}

RecordWrapper implements IRecord for backward compatibility

func (*RecordWrapper) Release

func (w *RecordWrapper) Release()

Release releases the record back to the pool

func (*RecordWrapper) ToModelsRecord

func (w *RecordWrapper) ToModelsRecord() *Record

ToModelsRecord returns the underlying Record

type Schema

type Schema struct {
	// Name of the schema
	Name string `json:"name"`

	// Version of the schema
	Version string `json:"version"`

	// Fields defines the structure of the data
	Fields []Field `json:"fields"`
}

Schema defines the structure of record data

Jump to

Keyboard shortcuts

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