PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/datastore

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
datastore
Namespace
g17khqpukees4237dtn3astzapmp462vjhsz6st4
Files
11 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/datastore
gno
0.9

Files (11)

  • README.mdmarkdown
  • gnomod.tomltoml
  • datastore.gnogno
  • index.gnogno
  • query_options.gnogno
  • query.gnogno
  • record.gnogno
  • schema_options.gnogno
  • schema.gnogno
  • storage_options.gnogno
  • storage.gnogno
  • query_options.gnogno
    1package datastore23import (4	"errors"5	"strings"6)78var (9	ErrEmptyQueryIndexName = errors.New("query index name is empty")10	ErrInvalidQueryOffset  = errors.New("minimum allowed query offset is 0")11	ErrInvalidQuerySize    = errors.New("minimum allowed query size is 1")12)1314// QueryOption configures queries.15type QueryOption func(*Query) error1617// WithOffset assigns the offset or position of the first record that query must return.18// The minimum allowed offset is 0.19func WithOffset(offset int) QueryOption {20	return func(q *Query) error {21		if offset < 0 {22			return ErrInvalidQueryOffset23		}2425		q.offset = offset26		return nil27	}28}2930// WithSize assigns the maximum number of records that query can return.31// The minimum allowed size is 1.32func WithSize(size int) QueryOption {33	return func(q *Query) error {34		if size < 1 {35			return ErrInvalidQuerySize36		}3738		q.size = size39		return nil40	}41}4243// UseIndex assigns the index that the query must use to get the records.44// Using an index requires a key value to locate the records within the index.45func UseIndex(name, key string) QueryOption {46	return func(q *Query) error {47		q.indexName = strings.TrimSpace(name)48		if q.indexName == "" {49			return ErrEmptyQueryIndexName50		}5152		q.indexKey = key53		return nil54	}55}56

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.