Documentation ¶
Index ¶
- Variables
- func Decode(buf []byte, fields []string, val any) error
- func DecodeSlice(buf []byte, fields []string, val any) error
- func ErrorStatus(err error) int
- type ApiError
- type ApiErrors
- type Client
- func (c *Client) Async(ctx context.Context, path string, headers http.Header, result any) FutureResult
- func (c *Client) CacheAdd(key, val any)
- func (c *Client) CacheGet(key any) (any, bool)
- func (c *Client) DefaultHeaders() http.Header
- func (c *Client) Delete(ctx context.Context, path string, headers http.Header) error
- func (c *Client) Get(ctx context.Context, path string, headers http.Header, result any) error
- func (c *Client) Post(ctx context.Context, path string, headers http.Header, data, result any) error
- func (c *Client) Put(ctx context.Context, path string, headers http.Header, data, result any) error
- func (c Client) Retries() int
- func (c Client) RetryDelay() time.Duration
- func (c *Client) UseScriptCache(cache *lru.TwoQueueCache)
- func (c *Client) WithApiKey(s string) *Client
- func (c *Client) WithCacheSize(sz int) *Client
- func (c *Client) WithHeader(key, value string) *Client
- func (c *Client) WithLogger(log log.Logger) *Client
- func (c *Client) WithRetry(num int, delay time.Duration) *Client
- func (c *Client) WithTLS(tc *tls.Config) *Client
- func (c *Client) WithTimeout(d time.Duration) *Client
- func (c *Client) WithUrl(url string) *Client
- func (c *Client) WithUserAgent(s string) *Client
- type Decoder
- type ErrRateLimited
- type FieldInfo
- type FillMode
- type Filter
- type FilterList
- type FilterMode
- type FormatType
- type FutureResult
- type HttpError
- type OrderType
- type Query
- func (p Query) And(key string) Query
- func (p Query) AndArg(key string, values ...any) Query
- func (p Query) AndEqual(key string, val any) Query
- func (p Query) AndFilter(key string, mode FilterMode, values ...any) Query
- func (p Query) AndGt(key string, val any) Query
- func (p Query) AndGte(key string, val any) Query
- func (p Query) AndIn(key string, val ...any) Query
- func (p Query) AndLt(key string, val any) Query
- func (p Query) AndLte(key string, val any) Query
- func (p Query) AndNot(key string) Query
- func (p Query) AndNotEqual(key string, val any) Query
- func (p Query) AndNotIn(key string, val ...any) Query
- func (p Query) AndRange(key string, from, to any) Query
- func (p Query) AndRegexp(key string, re string) Query
- func (p Query) Asc() Query
- func (p Query) Check() error
- func (p Query) Clone() Query
- func (p Query) Desc() Query
- func (p Query) Url() string
- func (p Query) WithCursor(v uint64) Query
- func (p Query) WithFrom(t time.Time) Query
- func (p Query) WithLimit(v uint) Query
- func (p Query) WithMerge() Query
- func (p Query) WithMeta() Query
- func (p Query) WithOffset(v uint) Query
- func (p Query) WithOrder(o OrderType) Query
- func (p Query) WithPath(path string) Query
- func (p Query) WithPrim() Query
- func (p Query) WithRights() Query
- func (p Query) WithStorage() Query
- func (p Query) WithTags(t ...string) Query
- func (p Query) WithTimeRange(from, to time.Time) Query
- func (p Query) WithTo(t time.Time) Query
- func (p Query) WithUnpack() Query
- type StreamResponse
- type TableQuery
- func (q *TableQuery[T]) AndEqual(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndFilter(mode FilterMode, col string, val ...any) *TableQuery[T]
- func (q *TableQuery[T]) AndGt(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndGte(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndIn(col string, val ...any) *TableQuery[T]
- func (q *TableQuery[T]) AndLt(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndLte(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndNotEqual(col string, val any) *TableQuery[T]
- func (q *TableQuery[T]) AndNotIn(col string, val ...any) *TableQuery[T]
- func (q *TableQuery[T]) AndRange(col string, from, to any) *TableQuery[T]
- func (q *TableQuery[T]) AndRegexp(col string, re string) *TableQuery[T]
- func (q *TableQuery[T]) Asc() *TableQuery[T]
- func (p TableQuery[T]) Check() error
- func (q *TableQuery[T]) Desc() *TableQuery[T]
- func (q *TableQuery[T]) GetColumns() []string
- func (q *TableQuery[T]) ReplaceFilter(mode FilterMode, col string, val ...any) *TableQuery[T]
- func (q *TableQuery[T]) ResetFilter() *TableQuery[T]
- func (q TableQuery[T]) Run(ctx context.Context) (*TableQueryResult[T], error)
- func (p TableQuery[T]) Url() string
- func (q *TableQuery[T]) WithColumns(cols ...string) *TableQuery[T]
- func (q *TableQuery[T]) WithCursor(c uint64) *TableQuery[T]
- func (q *TableQuery[T]) WithFormat(format FormatType) *TableQuery[T]
- func (q *TableQuery[T]) WithLimit(limit int) *TableQuery[T]
- func (q *TableQuery[T]) WithNoFail() *TableQuery[T]
- func (q *TableQuery[T]) WithOrder(order OrderType) *TableQuery[T]
- func (q *TableQuery[T]) WithPrim() *TableQuery[T]
- func (q *TableQuery[T]) WithQuiet() *TableQuery[T]
- func (q *TableQuery[T]) WithVerbose() *TableQuery[T]
- type TableQueryResult
- type TypeInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultLimit = 50000 DefaultCacheSize = 2048 )
Functions ¶
func ErrorStatus ¶
Types ¶
type ApiError ¶
type ApiErrors ¶
type ApiErrors struct {
Errors []ApiError `json:"errors"`
}
func (*ApiErrors) UnmarshalJSON ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DefaultHeaders ¶
func (Client) RetryDelay ¶
func (*Client) UseScriptCache ¶
func (c *Client) UseScriptCache(cache *lru.TwoQueueCache)
func (*Client) WithApiKey ¶
func (*Client) WithCacheSize ¶
func (*Client) WithHeader ¶
func (*Client) WithUserAgent ¶
type ErrRateLimited ¶
type ErrRateLimited struct { Status int IsResponseError bool Header http.Header // contains filtered or unexported fields }
func IsErrRateLimited ¶
func IsErrRateLimited(err error) (ErrRateLimited, bool)
func NewErrRateLimited ¶
func NewErrRateLimited(d time.Duration, isResponse bool) ErrRateLimited
func (ErrRateLimited) Deadline ¶
func (e ErrRateLimited) Deadline() time.Duration
func (ErrRateLimited) Done ¶
func (e ErrRateLimited) Done() <-chan struct{}
func (ErrRateLimited) Error ¶
func (e ErrRateLimited) Error() string
type FieldInfo ¶
FieldInfo holds details for the representation of a single field.
func (FieldInfo) ContainsFlag ¶
func (*FieldInfo) DerefIndirect ¶
Load value from interface, but only if the result will be usefully addressable.
type Filter ¶
type Filter struct { Mode FilterMode Column string Value any }
type FilterList ¶
type FilterList []Filter
func (*FilterList) Add ¶
func (l *FilterList) Add(mode FilterMode, col string, val ...any)
type FilterMode ¶
type FilterMode string
type FormatType ¶
type FormatType string
type FutureResult ¶
type FutureResult chan *response
func (FutureResult) Done ¶
func (r FutureResult) Done() bool
type Query ¶
func ParseQuery ¶
parse from http://server:port/prefix server:port/prefix server/prefix /prefix
func (Query) WithCursor ¶
func (Query) WithOffset ¶
func (Query) WithRights ¶
func (Query) WithStorage ¶
func (Query) WithUnpack ¶
type StreamResponse ¶
func NewStreamResponse ¶
func NewStreamResponse(header http.Header) (StreamResponse, error)
type TableQuery ¶
type TableQuery[T any] struct { Query Query Table string // "op", "block", "chain", "flow" Format FormatType // "json", "csv" Columns []string Limit int Cursor uint64 Verbose bool Prim bool NoFail bool Filter FilterList Order OrderType // asc, desc // contains filtered or unexported fields }
func NewTableQuery ¶
func NewTableQuery[T any](c *Client, name string) *TableQuery[T]
func (*TableQuery[T]) AndEqual ¶
func (q *TableQuery[T]) AndEqual(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndFilter ¶
func (q *TableQuery[T]) AndFilter(mode FilterMode, col string, val ...any) *TableQuery[T]
func (*TableQuery[T]) AndGt ¶
func (q *TableQuery[T]) AndGt(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndGte ¶
func (q *TableQuery[T]) AndGte(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndIn ¶
func (q *TableQuery[T]) AndIn(col string, val ...any) *TableQuery[T]
func (*TableQuery[T]) AndLt ¶
func (q *TableQuery[T]) AndLt(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndLte ¶
func (q *TableQuery[T]) AndLte(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndNotEqual ¶
func (q *TableQuery[T]) AndNotEqual(col string, val any) *TableQuery[T]
func (*TableQuery[T]) AndNotIn ¶
func (q *TableQuery[T]) AndNotIn(col string, val ...any) *TableQuery[T]
func (*TableQuery[T]) AndRange ¶
func (q *TableQuery[T]) AndRange(col string, from, to any) *TableQuery[T]
func (*TableQuery[T]) AndRegexp ¶
func (q *TableQuery[T]) AndRegexp(col string, re string) *TableQuery[T]
func (*TableQuery[T]) Asc ¶
func (q *TableQuery[T]) Asc() *TableQuery[T]
func (TableQuery[T]) Check ¶
func (p TableQuery[T]) Check() error
func (*TableQuery[T]) Desc ¶
func (q *TableQuery[T]) Desc() *TableQuery[T]
func (*TableQuery[T]) GetColumns ¶
func (q *TableQuery[T]) GetColumns() []string
func (*TableQuery[T]) ReplaceFilter ¶
func (q *TableQuery[T]) ReplaceFilter(mode FilterMode, col string, val ...any) *TableQuery[T]
func (*TableQuery[T]) ResetFilter ¶
func (q *TableQuery[T]) ResetFilter() *TableQuery[T]
func (TableQuery[T]) Run ¶
func (q TableQuery[T]) Run(ctx context.Context) (*TableQueryResult[T], error)
func (TableQuery[T]) Url ¶
func (p TableQuery[T]) Url() string
func (*TableQuery[T]) WithColumns ¶
func (q *TableQuery[T]) WithColumns(cols ...string) *TableQuery[T]
func (*TableQuery[T]) WithCursor ¶
func (q *TableQuery[T]) WithCursor(c uint64) *TableQuery[T]
func (*TableQuery[T]) WithFormat ¶
func (q *TableQuery[T]) WithFormat(format FormatType) *TableQuery[T]
func (*TableQuery[T]) WithLimit ¶
func (q *TableQuery[T]) WithLimit(limit int) *TableQuery[T]
func (*TableQuery[T]) WithNoFail ¶
func (q *TableQuery[T]) WithNoFail() *TableQuery[T]
func (*TableQuery[T]) WithOrder ¶
func (q *TableQuery[T]) WithOrder(order OrderType) *TableQuery[T]
func (*TableQuery[T]) WithPrim ¶
func (q *TableQuery[T]) WithPrim() *TableQuery[T]
func (*TableQuery[T]) WithQuiet ¶
func (q *TableQuery[T]) WithQuiet() *TableQuery[T]
func (*TableQuery[T]) WithVerbose ¶
func (q *TableQuery[T]) WithVerbose() *TableQuery[T]
type TableQueryResult ¶
type TableQueryResult[T any] struct { // contains filtered or unexported fields }
func NewTableQueryResult ¶
func NewTableQueryResult[T any](cols []string) *TableQueryResult[T]
func (*TableQueryResult[T]) Cursor ¶
func (r *TableQueryResult[T]) Cursor() uint64
func (*TableQueryResult[T]) Last ¶
func (r *TableQueryResult[T]) Last() (t T)
func (*TableQueryResult[T]) Len ¶
func (r *TableQueryResult[T]) Len() int
func (*TableQueryResult[T]) Rows ¶
func (r *TableQueryResult[T]) Rows() []T
func (*TableQueryResult[T]) UnmarshalJSON ¶
func (r *TableQueryResult[T]) UnmarshalJSON(data []byte) error
type TypeInfo ¶
TypeInfo holds details for the representation of a type.
func (TypeInfo) FieldNames ¶
func (TypeInfo) FilteredAliases ¶
Click to show internal directories.
Click to hide internal directories.