protoparser

package
v0.0.0-rc7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PackageTypeProtoseq  = MessagePackageType("PackageTypeProtoseq")
	PackageTypeRepeated  = MessagePackageType("PackageTypeRepeated")
	PackageTypeSingleMsg = MessagePackageType("PackageTypeSingleMsg")
)

Functions

func NewIterState

func NewIterState(msg parsers.Message, partition abstract.Partition) *iterState

Types

type ColParams

type ColParams struct {
	Name     string
	Required bool
}

func OptionalColumn

func OptionalColumn(name string) ColParams

func RequiredColumn

func RequiredColumn(name string) ColParams

type MessagePackageType

type MessagePackageType string

type ProtoParser

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

func NewProtoParser

func NewProtoParser(cfg *ProtoParserConfig, metrics *stats.SourceStats) (*ProtoParser, error)

func (*ProtoParser) ColSchema

func (p *ProtoParser) ColSchema() []abstract.ColSchema

func (*ProtoParser) ColumnNames

func (p *ProtoParser) ColumnNames() []string

func (*ProtoParser) Do

func (p *ProtoParser) Do(msg parsers.Message, partition abstract.Partition) (res []abstract.ChangeItem)

func (*ProtoParser) DoBatch

func (p *ProtoParser) DoBatch(batch parsers.MessageBatch) (res []abstract.ChangeItem)

type ProtoParserConfig

type ProtoParserConfig struct {
	ProtoMessageDesc   protoreflect.MessageDescriptor
	ScannerMessageDesc protoreflect.MessageDescriptor
	ProtoScannerType   protoscanner.ProtoScannerType
	IncludeColumns     []ColParams
	PrimaryKeys        []string
	LineSplitter       abstract.LfLineSplitter
	TableSplitter      *abstract.TableSplitter
	TimeField          *abstract.TimestampCol
	NullKeysAllowed    bool
	AddSystemColumns   bool
	SkipDedupKeys      bool
	AddSyntheticKeys   bool
}

func (*ProtoParserConfig) SetDescriptors

func (c *ProtoParserConfig) SetDescriptors(descFileContent []byte, messageName string, pkgType MessagePackageType) error

SetDescriptors sets ProtoMessageDesc & ScannerMessageDesc

func (*ProtoParserConfig) SetLineSplitter

func (c *ProtoParserConfig) SetLineSplitter(pkgType MessagePackageType)

func (*ProtoParserConfig) SetScannerType

func (c *ProtoParserConfig) SetScannerType(pkgType MessagePackageType)

Directories

Path Synopsis
gotest

Jump to

Keyboard shortcuts

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