Documentation
¶
Overview ¶
Package list implements a kiwi.Value which can store an array of strings.
Index ¶
Constants ¶
View Source
const ( // Get gets the string at the particular index. // If no index is provided it gets the last element. // // Returns a string. Get kiwi.Action = "GET" // Set sets the value of string at the index. // If no index is given and just the string, it updates the last element. // // Returns the sett-ed string. Set kiwi.Action = "SET" // Slice gets slice of the array from begin to end ( excluded ). // // Returns a slice of strings. Slice kiwi.Action = "SLICE" // Len gets the length of the list. // // Returns an integer. Len kiwi.Action = "LEN" // Append adds elements to the end of list. // // Returns a slice of strings which are appended. Append kiwi.Action = "APPEND" // Pop removes the last "n" elements from the string. // If "n" is not provided, pops last element. // // Returns a slice of removed strings. Pop kiwi.Action = "POP" // Remove removes the elements specified from the list. // These can be indexes or the elements themselves. // // Returns the removed string. Remove kiwi.Action = "REMOVE" // Find gets the index of element if it exists else -1. // // Returns an integer. Find kiwi.Action = "FIND" )
View Source
const Type kiwi.ValueType = "list"
Type of list value.
Variables ¶
View Source
var ( ErrInvalidIndex = fmt.Errorf("cannot access invalid index") ErrInvalidParamLen = fmt.Errorf("not enough parameters") ErrInvalidParamType = fmt.Errorf("invalid paramater type") )
Various errors for list value type.
Functions ¶
This section is empty.
Types ¶
type Value ¶
type Value []string
Value can store an array of strings.
It implements the kiwi.Value interface.
func (*Value) FromJSON ¶
func (v *Value) FromJSON(rawmessage json.RawMessage) error
FromJSON populates the s with the data from RawMessage
Click to show internal directories.
Click to hide internal directories.