utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 11 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

This section is empty.

Functions

func Create

func Create(value any) (*prefabProto.ConfigValue, bool)

Create switches on the type of the any value passed in - will return the prefabConfigValue of a matching type if possible -- ie pass in an int, get back a ConfigValue_Int

func ExtractBoolValue

func ExtractBoolValue(cv *prefabProto.ConfigValue) (bool, bool)

func ExtractDurationValue

func ExtractDurationValue(cv *prefabProto.ConfigValue) (time.Duration, bool)

func ExtractFloatValue

func ExtractFloatValue(cv *prefabProto.ConfigValue) (float64, bool)

func ExtractIntValue

func ExtractIntValue(cv *prefabProto.ConfigValue) (int64, bool)

func ExtractJSONValue

func ExtractJSONValue(cv *prefabProto.ConfigValue) (interface{}, bool, error)

func ExtractJSONValueWithoutError added in v0.0.4

func ExtractJSONValueWithoutError(cv *prefabProto.ConfigValue) (interface{}, bool)

func ExtractLogLevelValue

func ExtractLogLevelValue(cv *prefabProto.ConfigValue) (prefabProto.LogLevel, bool)

func ExtractStringListValue

func ExtractStringListValue(cv *prefabProto.ConfigValue) ([]string, bool)

func ExtractStringValue

func ExtractStringValue(cv *prefabProto.ConfigValue) (string, bool)

func ExtractValue

func ExtractValue(cv *prefabProto.ConfigValue) (any, bool, error)

ExtractValue returns the value of the oneof field and a boolean indicating if it's one of the simple types (fields 1-5, 10). returns nil, false if the configvalue is nil

func GetValueType

GetValueType returns the value type we'd expect the config containing this value to have

Types

type ExtractValueFunction

type ExtractValueFunction func(*prefabProto.ConfigValue) (any, bool)

Jump to

Keyboard shortcuts

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