Documentation ¶
Overview ¶
shexp provides shell-like varianble expansions
Index ¶
- func Expand(in io.Reader) (string, error)
- func ExpandBytes(b []byte) (string, error)
- func ExpandString(s string, args ...interface{}) (string, error)
- type EnvResolver
- type Expander
- func (exp *Expander) Expand(in io.Reader) (string, error)
- func (exp *Expander) ExpandBytes(b []byte) (string, error)
- func (exp *Expander) ExpandString(s string, args ...interface{}) (string, error)
- func (exp *Expander) Get(key string) string
- func (exp *Expander) NewBytesParser(b []byte) *Parser
- func (exp *Expander) NewParser(in io.Reader) *Parser
- func (exp *Expander) NewStringParser(s string, args ...interface{}) *Parser
- func (exp *Expander) Reset()
- func (exp *Expander) Set(key, value string) string
- type Parser
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandBytes ¶
func ExpandString ¶
Types ¶
type EnvResolver ¶
type EnvResolver struct {
// contains filtered or unexported fields
}
func (*EnvResolver) Get ¶
func (r *EnvResolver) Get(key string) string
func (*EnvResolver) Reset ¶
func (r *EnvResolver) Reset()
func (*EnvResolver) Set ¶
func (r *EnvResolver) Set(key, value string) string
type Expander ¶
type Expander struct {
// contains filtered or unexported fields
}
A Expander is an object that can be used to Expand strings
func NewExpander ¶
NewExpander allocates a new Expander using a given Resolver, or os.Getenv if none is given
func (*Expander) ExpandBytes ¶
ExpandBytes expands variables on a given text as []byte
func (*Expander) ExpandString ¶
ExpandString expands variables on a given string
func (*Expander) NewBytesParser ¶
func (*Expander) NewStringParser ¶
Constructor
Click to show internal directories.
Click to hide internal directories.