Documentation ¶
Overview ¶
Commands for manipulating the current Friendscript variable scope.
Index ¶
- type Commands
- func (self *Commands) Clear(key string)
- func (self *Commands) Ensure(key string, args *EnsureArgs) error
- func (self *Commands) Get(key string, args *GetArgs) (interface{}, error)
- func (self *Commands) Interpolate(format string, args *InterpolateArgs) (string, error)
- func (self *Commands) Keys() ([]string, error)
- func (self *Commands) Pop(key string) (interface{}, error)
- func (self *Commands) Push(key string, args *PushArgs) error
- func (self *Commands) Set(key string, args *SetArgs) (interface{}, error)
- type EnsureArgs
- type GetArgs
- type InterpolateArgs
- type PushArgs
- type SetArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commands ¶
func (*Commands) Ensure ¶
func (self *Commands) Ensure(key string, args *EnsureArgs) error
Emit an error if the given key does not exist, optionally with a user-specified message.
func (*Commands) Interpolate ¶
func (self *Commands) Interpolate(format string, args *InterpolateArgs) (string, error)
Return a value interpolated with values from a scope or ones that are explicitly provided.
func (*Commands) Pop ¶
Take the last value from the array at key. If key is an array, the last value of that array will be returned and the remainder will be left at key. Empty arrays will return nil and be unset. Non-array values will be returned and the key will be unset.
type EnsureArgs ¶
type EnsureArgs struct {
Message string `json:"message"`
}
type InterpolateArgs ¶
type InterpolateArgs struct {
Values interface{} `json:"values"`
}
Click to show internal directories.
Click to hide internal directories.