logqleval

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 4 Imported by: 0 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 (
	MakeFlatGoMap MakeMap = func(prefixes []string, kvs []*typesv1.KV, mkMap MakeMap, mkSlice MakeSlice, setVal func([]string, any) error) error {
		if len(prefixes) != 0 {

			for _, kv := range kvs {
				keys := append(prefixes, kv.Key)
				err := resolveVal(keys, kv.Value, mkMap, mkSlice, setVal)
				if err != nil {
					return err
				}
			}
			return nil
		}
		out := make(map[string]any, len(kvs))
		for _, kv := range kvs {
			keys := []string{kv.Key}
			err := resolveVal(keys, kv.Value, mkMap, mkSlice, func(s []string, a any) error {
				k := strings.Join(s, ".")
				out[k] = a
				return nil
			})
			if err != nil {
				return err
			}
		}
		return setVal(nil, out)
	}
	MakeFlatMapGoSlice MakeSlice = func(prefixes []string, elems []*typesv1.Val, mkMap MakeMap, mkSlice MakeSlice, setVal func([]string, any) error) error {
		if len(prefixes) != 0 {

			for i, el := range elems {
				keys := append(prefixes, strconv.Itoa(i))
				err := resolveVal(keys, el, mkMap, mkSlice, setVal)
				if err != nil {
					return err
				}
			}
			return nil
		}
		out := make(map[string]any, len(elems))
		for i, el := range elems {
			keys := []string{strconv.Itoa(i)}
			err := resolveVal(keys, el, mkMap, mkSlice, func(s []string, a any) error {
				k := strings.Join(s, ".")
				out[k] = a
				return nil
			})
			if err != nil {
				return err
			}
		}
		return setVal(nil, out)
	}
	MakeFlatGoSlice MakeSlice = func(prefixes []string, elems []*typesv1.Val, mkMap MakeMap, mkSlice MakeSlice, setVal func([]string, any) error) error {
		if len(prefixes) != 0 {

			for i, el := range elems {
				keys := append(prefixes, strconv.Itoa(i))
				err := resolveVal(keys, el, mkMap, mkSlice, setVal)
				if err != nil {
					return err
				}
			}
			return nil
		}
		out := make([]any, 0, len(elems))
		for _, el := range elems {
			err := resolveVal(nil, el, mkMap, mkSlice, func(s []string, a any) error {
				out = append(out, a)
				return nil
			})
			if err != nil {
				return err
			}
		}
		return setVal(nil, out)
	}
)

Functions

func ResolveVal

func ResolveVal(v *typesv1.Val, mkMap MakeMap, mkSlice MakeSlice) (any, error)

func VisitScalars

func VisitScalars(v *typesv1.Val, onScalar func(keys []string, scalar *typesv1.Val) error, prefixes ...string) error

Types

type MakeMap

type MakeMap func(prefixes []string, kvs []*typesv1.KV, mkMap MakeMap, mkSlice MakeSlice, setVal func([]string, any) error) error

type MakeSlice

type MakeSlice func(prefixes []string, items []*typesv1.Val, mkMap MakeMap, mkSlice MakeSlice, setVal func([]string, any) error) error

Jump to

Keyboard shortcuts

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