path

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidFormat

func IsInvalidFormat(err error) bool

IsInvalidFormat asserts invalidFormatError.

func IsKeyNotIndex

func IsKeyNotIndex(err error) bool

IsKeyNotIndex asserts keyNotIndexError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Config

type Config struct {
	// Settings.
	InputBytes []byte
	Separator  string
}

Config represents the configuration used to create a new path service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new path service by best effort.

type Service

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

Service implements the path service.

func New

func New(config Config) (*Service, error)

New creates a new configured path service.

func (*Service) All

func (s *Service) All() ([]string, error)

All returns all paths found in the configured JSON structure.

func (*Service) Get

func (s *Service) Get(path string) (interface{}, error)

Get returns the value found under the given path, if any.

func (*Service) OutputBytes

func (s *Service) OutputBytes() ([]byte, error)

func (*Service) Set

func (s *Service) Set(path string, value interface{}) error

Set changes the value of the given path.

func (*Service) Validate

func (s *Service) Validate(paths []string) error

Jump to

Keyboard shortcuts

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