sanitize

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sanitize provides a Scrapper decorator that strips NUL bytes and repairs invalid UTF-8 in every row returned by the underlying scrapper. Downstream systems (Postgres text columns, JSON encoders, protobuf text fields) reject these byte sequences, so every scrapper should be wrapped at construction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SanitizingScrapper

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

func NewSanitizingScrapper

func NewSanitizingScrapper(inner scrapper.Scrapper) *SanitizingScrapper

NewSanitizingScrapper wraps inner so that every returned row has its string fields cleaned via each row type's Sanitize() method. Clean strings are returned unchanged with zero allocation, so the overhead on well-formed data is negligible.

func (*SanitizingScrapper) Capabilities

func (s *SanitizingScrapper) Capabilities() scrapper.Capabilities

func (*SanitizingScrapper) Close

func (s *SanitizingScrapper) Close() error

func (*SanitizingScrapper) DialectType

func (s *SanitizingScrapper) DialectType() string

func (*SanitizingScrapper) IsPermissionError

func (s *SanitizingScrapper) IsPermissionError(err error) bool

func (*SanitizingScrapper) QueryCatalog

func (s *SanitizingScrapper) QueryCatalog(ctx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*SanitizingScrapper) QueryCustomMetrics

func (s *SanitizingScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*SanitizingScrapper) QueryDatabases

func (s *SanitizingScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*SanitizingScrapper) QuerySegments

func (s *SanitizingScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*SanitizingScrapper) QueryShape

func (s *SanitizingScrapper) QueryShape(ctx context.Context, sql string) ([]*scrapper.QueryShapeColumn, error)

func (*SanitizingScrapper) QuerySqlDefinitions

func (s *SanitizingScrapper) QuerySqlDefinitions(ctx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*SanitizingScrapper) QueryTableConstraints

func (s *SanitizingScrapper) QueryTableConstraints(ctx context.Context) ([]*scrapper.TableConstraintRow, error)

func (*SanitizingScrapper) QueryTableMetrics

func (s *SanitizingScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*SanitizingScrapper) QueryTables

func (*SanitizingScrapper) SqlDialect

func (s *SanitizingScrapper) SqlDialect() sqldialect.Dialect

func (*SanitizingScrapper) ValidateConfiguration

func (s *SanitizingScrapper) ValidateConfiguration(ctx context.Context) (warnings []string, err error)

Jump to

Keyboard shortcuts

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