object

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotExist = errors.New("does not exist")
)

Functions

This section is empty.

Types

type DataTypes

type DataTypes interface {
	Opaque | Refrence
}

type MatchType

type MatchType int
const (
	ExactMatch MatchType = iota
	PrefixMatch
	SuffixMatch
	SubMatch
	RegExMatch
)

type Object

type Object[T DataTypes] interface {
	Children() []string
	Child(any) Selector[T]
	CreatePath(path ...string) (Object[T], error)
	Fetch(path ...string) (Object[T], error)
	Set(string, T)
	Get(string) T
	GetString(string) (string, error)
	GetInt(string) (int, error)
	GetBool(string) (bool, error)
	Delete(string)
	Move(string, string) error // rename attribute
	Map() map[string]any
	Flat() map[string]any
	Match(string, MatchType) ([]Object[T], error)
}

func New

func New[T DataTypes]() Object[T]

type Opaque

type Opaque []byte

type Refrence

type Refrence any

type Resolver

type Resolver[T DataTypes] interface {
	Root() Object[T]
	Resolve(path ...string) (Object[T], error)
}

func NewResolver

func NewResolver[T DataTypes](root Object[T]) Resolver[T]

type Selector

type Selector[T DataTypes] interface {
	Name() string
	Exists() bool
	Rename(string) error       // rename self in parent
	Move(string, string) error // rename attribute
	Set(string, T) error
	Get(string) (T, error)
	GetString(string) (string, error)
	GetInt(string) (int, error)
	GetBool(string) (bool, error)
	Delete(string)
	Add(Object[T]) error
	Object() (Object[T], error)
}

Jump to

Keyboard shortcuts

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