util

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert2JavaProps

func Convert2JavaProps(_ string, content []byte) (map[string]interface{}, error)

Convert2JavaProps is a FileHandler it convert the yaml content into java props.

func ExpandValueEnv

func ExpandValueEnv(value string) (realValue string)

if string like ${NAME||archaius} will query environment variable for ${NAME} if environment variable is "" return default string `archaius` support multi variable, eg:

value string => addr:${IP||127.0.0.1}:${PORT||8080}
if environment variable =>  IP=0.0.0.0 PORT=443 , result => addr:0.0.0.0:443
if no exist environment variable                , result => addr:127.0.0.1:8080

func UseFileNameAsKeyContentAsValue

func UseFileNameAsKeyContentAsValue(p string, content []byte) (map[string]interface{}, error)

UseFileNameAsKeyContentAsValue is a FileHandler, it sets the yaml file name as key and the content as value.

Types

type FileHandler

type FileHandler func(filePath string, content []byte) (map[string]interface{}, error)

FileHandler decide how to convert a file content into key values archaius will manage file content as those key values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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