Documentation
¶
Index ¶
- func Decode(bs []byte) ([]idl.Type, []any, error)
- func DecodeValueString(value []byte) (string, error)
- func DecodeValuesString(types []idl.Type, values []any) (string, error)
- func Encode(argumentTypes []idl.Type, arguments []any) ([]byte, error)
- func EncodeValueString(value string) ([]byte, error)
- func Marshal(args []any) ([]byte, error)
- func Unmarshal(data []byte, values []any) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeValueString ¶
DecodeValueString decodes the given value into a candid string.
func DecodeValuesString ¶
DecodeValuesString decodes the given values into a candid string.
func EncodeValueString ¶
EncodeValueString encodes the given candid string into a byte slice.
Example ¶
package main import ( "fmt" "github.com/aviate-labs/agent-go/candid" ) func main() { e, _ := candid.EncodeValueString("0") fmt.Printf("%x\n", e) }
Output: 4449444c00017c00
Example (Blob) ¶
package main import ( "fmt" "github.com/aviate-labs/agent-go/candid" ) func main() { e, _ := candid.EncodeValueString("(blob \"deadbeef\")") fmt.Printf("%x\n", e) }
Output: 4449444c016d7b0100086465616462656566
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
candid
Package candid is autogenerated by https://github.com/0x51-dev/upeg.
|
Package candid is autogenerated by https://github.com/0x51-dev/upeg. |
ctest
Package ctest is autogenerated by https://github.com/0x51-dev/upeg.
|
Package ctest is autogenerated by https://github.com/0x51-dev/upeg. |
cvalue
Package cvalue is autogenerated by https://github.com/0x51-dev/upeg.
|
Package cvalue is autogenerated by https://github.com/0x51-dev/upeg. |
Click to show internal directories.
Click to hide internal directories.