Documentation ¶
Overview ¶
Package requestargs implements special encoding of the dict.Dict which allows optimized transfer of big data through SC request. It encodes big data chunks as hashes, which later can be decoded (solidified) into the original form treating the hashes as content addresses on IPFS and other mediums well suited for dalivery of big data chunks to wasm nodes
Index ¶
- type RequestArgs
- func (a RequestArgs) AddAsBlobRef(name kv.Key, data []byte) hashing.HashValue
- func (a RequestArgs) AddEncodeBlobRef(name kv.Key, hash hashing.HashValue) RequestArgs
- func (a RequestArgs) AddEncodeSimple(name kv.Key, data []byte) RequestArgs
- func (a RequestArgs) AddEncodeSimpleMany(d dict.Dict) RequestArgs
- func (a RequestArgs) Bytes() []byte
- func (a RequestArgs) Clone() RequestArgs
- func (a RequestArgs) ReadFromMarshalUtil(mu *marshalutil.MarshalUtil) error
- func (a RequestArgs) SolidifyRequestArguments(reg registry.BlobCache, downloaderOpt ...*downloader.Downloader) (dict.Dict, bool, error)
- func (a RequestArgs) String() string
- func (a RequestArgs) WriteToMarshalUtil(mu *marshalutil.MarshalUtil)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestArgs ¶
RequestArgs encodes request parameters taking into account hashes of data blobs
func FromMarshalUtil ¶
func FromMarshalUtil(mu *marshalutil.MarshalUtil) (RequestArgs, error)
func New ¶
func New(d ...dict.Dict) RequestArgs
New makes new object taking 'as is', without encoding
func NewOptimizedRequestArgs ¶
NewOptimizedRequestArgs takes dictionary and encodes it
func (RequestArgs) AddAsBlobRef ¶
AddAsBlobRef adds argument with the data hash instead of data itself. Encodes key as "blob reference"
func (RequestArgs) AddEncodeBlobRef ¶
func (a RequestArgs) AddEncodeBlobRef(name kv.Key, hash hashing.HashValue) RequestArgs
AddEncodeBlobRef adds hash as data and marks it is a blob reference
func (RequestArgs) AddEncodeSimple ¶
func (a RequestArgs) AddEncodeSimple(name kv.Key, data []byte) RequestArgs
AddEncodeSimple add new ordinary argument. Encodes the key as "normal"
func (RequestArgs) AddEncodeSimpleMany ¶
func (a RequestArgs) AddEncodeSimpleMany(d dict.Dict) RequestArgs
func (RequestArgs) Bytes ¶
func (a RequestArgs) Bytes() []byte
func (RequestArgs) Clone ¶
func (a RequestArgs) Clone() RequestArgs
func (RequestArgs) ReadFromMarshalUtil ¶
func (a RequestArgs) ReadFromMarshalUtil(mu *marshalutil.MarshalUtil) error
func (RequestArgs) SolidifyRequestArguments ¶
func (a RequestArgs) SolidifyRequestArguments(reg registry.BlobCache, downloaderOpt ...*downloader.Downloader) (dict.Dict, bool, error)
SolidifyRequestArguments decodes RequestArgs. each key-value pair ir treated according to the first byte of the key:
- if the key starts with '*' the value is a content reference. First 32 bytes of the value are always treated as data hash. The rest (if any) is a content address. It will be treated by a downloader
- otherwise, value is treated a raw data and the first byte of the key is ignored
func (RequestArgs) String ¶
func (a RequestArgs) String() string
func (RequestArgs) WriteToMarshalUtil ¶
func (a RequestArgs) WriteToMarshalUtil(mu *marshalutil.MarshalUtil)