utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 11 Imported by: 0

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