schema

package
v0.1.2-beta Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmpty    = errors.New("empty schema")
	ErrMismatch = errors.New("schema mismatch")
)

Functions

This section is empty.

Types

type Schema

type Schema map[string]reflect.Type

func FromTuple

func FromTuple(t map[string]any) Schema

func (Schema) Equal

func (s Schema) Equal(t Schema) bool

Equal reports whether two schemas contain the same key/value pairs. Values are compared using ==.

func (Schema) Has

func (s Schema) Has(k string) bool

Has reports whether s contains the key k.

func (Schema) Intersection

func (s Schema) Intersection(t Schema) Schema

Intersection returns a new schema with the common key/value pairs of s and t.

func (Schema) IsSubsetOf

func (s Schema) IsSubsetOf(t Schema) bool

func (Schema) Projection

func (s Schema) Projection(p ...string) (Schema, bool)

Projection returns a new schema with the keys of p that are in s.

Jump to

Keyboard shortcuts

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