package
1.16.2
Repository: https://github.com/zclconf/go-cty.git
Documentation: pkg.go.dev

# Functions

Absolute returns the magnitude of the given number, without its sign.
Add returns the sum of the two given numbers.
And returns true if and only if both of the given boolean values are true.
No description provided by the author
No description provided by the author
No description provided by the author
BytesVal creates a new Bytes value from the given buffer, which must be non-nil or this function will panic.
Ceil returns the closest whole number greater than or equal to the given value.
Chomp removes newline characters at the end of a string.
Chunklist splits a single list into fixed-size chunks, returning a list of lists.
Coalesce returns the first of the given arguments that is not null.
CoalesceList takes any number of list arguments and returns the first one that isn't empty.
Compact takes a list of strings and returns a new list with any empty string elements removed.
Concat takes one or more sequences (lists or tuples) and returns the single sequence that results from concatenating them together in order.
Contains determines whether a given list contains a given single value as one of its elements.
CSVDecode parses the given CSV (RFC 4180) string and, if it is valid, returns a list of objects representing the rows.
Distinct takes a list and returns a new list with any duplicate elements removed.
Divide returns a divided by b, where both a and b are numbers.
Element returns a single element from a given list at the given index.
Equal determines whether the two given values are equal, returning a bool value.
Flatten takes a list and replaces any elements that are lists with a flattened sequence of the list contents.
Floor returns the closest whole number lesser than or equal to the given value.
Format produces a string representation of zero or more values using a format string similar to the "printf" function in C.
FormatDate reformats a timestamp given in RFC3339 syntax into another time syntax defined by a given format string.
FormatList applies the same formatting behavior as Format, but accepts a mixture of list and non-list values as arguments.
GreaterThan returns true if a is less than b.
GreaterThanOrEqualTo returns true if a is less than b.
HasIndex determines whether the given collection can be indexed with the given key.
Indent adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
Index returns an element from the given collection using the given key, or returns an error if there is no element for the given key.
Int removes the fractional component of the given number returning an integer representing the whole number component, rounding towards zero.
Join concatenates together the string elements of one or more lists with a given separator.
JSONDecode parses the given JSON string and, if it is valid, returns the value it represents.
JSONEncode returns a JSON serialization of the given value.
Keys takes a map and returns a sorted list of the map keys.
Length returns the number of elements in the given collection.
LessThan returns true if a is less than b.
LessThanOrEqualTo returns true if a is less than b.
Log returns returns the logarithm of a given number in a given base.
Lookup performs a dynamic lookup into a map.
Lower is a Function that converts a given string to lowercase.
MakeToFunc constructs a "to..." function, like "tostring", which converts its argument to a specific type or type kind.
Max returns the maximum number from the given numbers.
Merge takes an arbitrary number of maps and returns a single map that contains a merged set of elements from all of the maps.
Min returns the minimum number from the given numbers.
Modulo returns the remainder of a divided by b under integer division, where both a and b are numbers.
Multiply returns the product of the two given numbers.
Negate returns the given number multipled by -1.
Not returns the logical complement of the given boolean value.
NotEqual is the opposite of Equal.
Or returns true if either of the given boolean values are true.
ParseInt parses a string argument and returns an integer of the specified base.
Pow returns the logarithm of a given number in a given base.
Range creates a list of numbers by starting from the given starting value, then adding the given step value until the result is greater than or equal to the given stopping value.
Regex is a function that extracts one or more substrings from a given string by applying a regular expression pattern, describing the first match.
RegexAll is similar to Regex but it finds all of the non-overlapping matches in the given string and returns a list of them.
No description provided by the author
Replace searches a given string for another given substring, and replaces all occurrences with a given replacement string.
Reverse is a Function that reverses the order of the characters in the given string.
ReverseList takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order.
SetHasElement determines whether the given set contains the given value as an element.
Intersection returns a new set containing the elements that exist in all of the given sets, which must have element types that can all be converted to some common type using the standard type unification rules.
SetProduct computes the Cartesian product of sets or sequences.
SetSubtract returns a new set containing the elements from the first set that are not present in the second set.
SetSymmetricDifference returns a new set containing elements that appear in any of the given sets but not multiple.
SetUnion returns a new set containing all of the elements from the given sets, which must have element types that can all be converted to some common type using the standard type unification rules.
Signum determines the sign of a number, returning a number between -1 and 1 to represent the sign.
Slice extracts some consecutive elements from within a list.
Sort re-orders the elements of a given list of strings so that they are in ascending lexicographical order.
Split divides a given string by a given separator, returning a list of strings containing the characters between the separator sequences.
Strlen is a Function that returns the length of the given string in characters.
Substr is a Function that extracts a sequence of characters from another string and creates a new string.
Subtract returns the difference between the two given numbers.
TimeAdd adds a duration to a timestamp, returning a new timestamp.
Title converts the first letter of each word in the given string to uppercase.
Trim removes the specified characters from the start and end of the given string.
TrimPrefix removes the specified prefix from the start of the given string.
TrimSpace removes any space characters from the start and end of the given string.
TrimSuffix removes the specified suffix from the end of the given string.
Upper is a Function that converts a given string to uppercase.
Values returns a list of the map values, in the order of the sorted keys.
Zipmap constructs a map from a list of keys and a corresponding list of values.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
AssertNotNullFunc is a function which does nothing except return an error if the argument given to it is null.
Bytes is a capsule type that can be used with the binary functions to support applications that need to support raw buffers in addition to UTF-8 strings.
BytesLen is a Function that returns the length of the buffer encapsulated in a Bytes value.
BytesSlice is a Function that returns a slice of the given Bytes value.
CeilFunc is a function that returns the closest whole number greater than or equal to the given value.
ChompFunc is a function that removes newline characters at the end of a string.
ChunklistFunc is a function that splits a single list into fixed-size chunks, returning a list of lists.
No description provided by the author
CoalesceListFunc is a function that takes any number of list arguments and returns the first one that isn't empty.
CompactFunc is a function that takes a list of strings and returns a new list with any empty string elements removed.
No description provided by the author
ContainsFunc is a function that determines whether a given list or set contains a given single value as one of its elements.
No description provided by the author
DistinctFunc is a function that takes a list and returns a new list with any duplicate elements removed.
No description provided by the author
No description provided by the author
No description provided by the author
FlattenFunc is a function that takes a list and replaces any elements that are lists with a flattened sequence of the list contents.
FloorFunc is a function that returns the closest whole number lesser than or equal to the given value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IndentFunc is a function that adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
KeysFunc is a function that takes a map and returns a sorted list of the map keys.
No description provided by the author
No description provided by the author
No description provided by the author
LogFunc is a function that returns the logarithm of a given number in a given base.
LookupFunc is a function that performs dynamic lookups of map types.
No description provided by the author
No description provided by the author
MergeFunc constructs a function that takes an arbitrary number of maps or objects, and returns a single value that contains a merged set of keys and values from all of the inputs.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParseIntFunc is a function that parses a string argument and returns an integer of the specified base.
PowFunc is a function that returns the logarithm of a given number in a given base.
No description provided by the author
No description provided by the author
No description provided by the author
RegexReplaceFunc is a function that searches a given string for another given substring, and replaces each occurence with a given replacement string.
ReplaceFunc is a function that searches a given string for another given substring, and replaces each occurence with a given replacement string.
No description provided by the author
ReverseListFunc takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order.
No description provided by the author
No description provided by the author
SetProductFunc calculates the Cartesian product of two or more sets or sequences.
No description provided by the author
No description provided by the author
No description provided by the author
SignumFunc is a function that determines the sign of a number, returning a number between -1 and 1 to represent the sign..
SliceFunc is a function that extracts some consecutive elements from within a list.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeAddFunc is a function that adds a duration to a timestamp, returning a new timestamp.
TitleFunc is a function that converts the first letter of each word in the given string to uppercase.
TrimFunc is a function that removes the specified characters from the start and end of the given string.
TrimPrefixFunc is a function that removes the specified characters from the start the given string.
TrimSpaceFunc is a function that removes any space characters from the start and end of the given string.
TrimSuffixFunc is a function that removes the specified characters from the end of the given string.
No description provided by the author
ValuesFunc is a function that returns a list of the map values, in the order of the sorted keys.
ZipmapFunc is a function that constructs a map from a list of keys and a corresponding list of values.