validator

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFatal = errFatal("fatal error")

Functions

This section is empty.

Types

type Check

type Check struct {
	Title   string `json:"title"`
	Run     bool   `json:"run"`
	Passed  bool   `json:"passed"`
	Message string `json:"message,omitempty"`
}

type ColumnMetdataMap

type ColumnMetdataMap map[string]map[string]any

type ColumnValueRule

type ColumnValueRule[T any] struct {
	// contains filtered or unexported fields
}

func (*ColumnValueRule[T]) Init

func (r *ColumnValueRule[T]) Init(info *FileInfo)

func (*ColumnValueRule[T]) Title

func (r *ColumnValueRule[T]) Title() string

func (*ColumnValueRule[T]) Validate

func (r *ColumnValueRule[T]) Validate() error

func (*ColumnValueRule[T]) Value

func (r *ColumnValueRule[T]) Value(name string, data T) error

type FileInfo

type FileInfo struct {
	File     *file.Reader
	Metadata *geoparquet.Metadata
}

type GenericRule

type GenericRule[T RuleData] struct {
	// contains filtered or unexported fields
}

func (*GenericRule[T]) Init

func (r *GenericRule[T]) Init(value T)

func (*GenericRule[T]) Title

func (r *GenericRule[T]) Title() string

func (*GenericRule[T]) Validate

func (r *GenericRule[T]) Validate() error

type MetadataMap

type MetadataMap map[string]any

type Report

type Report struct {
	Checks       []*Check `json:"checks"`
	MetadataOnly bool     `json:"metadataOnly"`
}

type Rule

type Rule interface {
	Title() string
	Validate() error
}

func DataScanningRules

func DataScanningRules() []Rule

func GeometryBounds

func GeometryBounds() Rule

func GeometryDataType

func GeometryDataType() Rule

func GeometryEncoding

func GeometryEncoding() Rule

func GeometryOrientation

func GeometryOrientation() Rule

func GeometryRepetition

func GeometryRepetition() Rule

func GeometryTypes

func GeometryTypes() Rule

func GeometryUngrouped

func GeometryUngrouped() Rule

func MetadataOnlyRules

func MetadataOnlyRules() []Rule

func OptionalBbox

func OptionalBbox() Rule

func OptionalCRS

func OptionalCRS() Rule

func OptionalEdges

func OptionalEdges() Rule

func OptionalEpoch

func OptionalEpoch() Rule

func OptionalOrientation

func OptionalOrientation() Rule

func PrimaryColumnInLookup

func PrimaryColumnInLookup() Rule

func RequiredColumnEncoding

func RequiredColumnEncoding() Rule

func RequiredColumns

func RequiredColumns() Rule

func RequiredGeoKey

func RequiredGeoKey() Rule

func RequiredGeometryTypes

func RequiredGeometryTypes() Rule

func RequiredMetadataType

func RequiredMetadataType() Rule

func RequiredPrimaryColumn

func RequiredPrimaryColumn() Rule

func RequiredVersion

func RequiredVersion() Rule

type RuleData

type RuleData interface {
	*file.Reader | MetadataMap | ColumnMetdataMap | *FileInfo
}

type Validator

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

func New

func New(metadataOnly bool) *Validator

New creates a new Validator.

func (*Validator) Report

func (v *Validator) Report(ctx context.Context, file *file.Reader) (*Report, error)

Report generates a validation report for a GeoParquet file.

func (*Validator) Validate

func (v *Validator) Validate(ctx context.Context, input parquet.ReaderAtSeeker, name string) (*Report, error)

Validate opens and validates a GeoParquet file.

Jump to

Keyboard shortcuts

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