Versions in this module Expand all Collapse all v0 v0.18.1 Jan 31, 2024 v0.18.0 Jan 29, 2024 v0.17.5 Dec 15, 2023 Changes in this version + type ErrApi struct + Code int + Detail string + Message string + Reason string + RequestId string + Request_ string + Scope string + Status_ int + func (e *ErrApi) Body() []byte + func (e *ErrApi) Error() string + func (e *ErrApi) Request() string + func (e *ErrApi) Status() string + func (e *ErrApi) StatusCode() int + func (e *ErrApi) UnmarshalJSON(buf []byte) error + type ErrHttp struct + func (e *ErrHttp) Body() []byte + func (e *ErrHttp) Decode(v interface{}) error + func (e *ErrHttp) Error() string + func (e *ErrHttp) Request() string + func (e *ErrHttp) Status() string + func (e *ErrHttp) StatusCode() int + type HTTPError interface + Body func() []byte + type HTTPStatus interface + Request func() string + Status func() string + StatusCode func() int v0.17.4 Nov 1, 2023 v0.17.3 Oct 6, 2023 v0.17.2 Jul 4, 2023 Changes in this version + var DefaultCacheSize = 2048 + var DefaultLimit = 50000 + 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 struct + Code int + Detail string + Message string + Reason string + RequestId string + Scope string + Status int + func (e ApiError) Error() string + type ApiErrors struct + Errors []ApiError + func IsErrApi(err error) (ApiErrors, bool) + func (e *ApiErrors) UnmarshalJSON(buf []byte) error + func (e ApiErrors) Error() string + type Client struct + func NewClient(url string, httpClient *http.Client) *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) 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 + func (c Client) Retries() int + func (c Client) RetryDelay() time.Duration + type Decoder struct + type ErrRateLimited struct + Header http.Header + IsResponseError bool + Status int + func IsErrRateLimited(err error) (ErrRateLimited, bool) + func NewErrRateLimited(d time.Duration, isResponse bool) ErrRateLimited + func (e ErrRateLimited) Deadline() time.Duration + func (e ErrRateLimited) Done() <-chan struct{} + func (e ErrRateLimited) Error() string + func (e ErrRateLimited) Wait(ctx context.Context) error + type FieldInfo struct + Alias string + Flags int + Idx []int + Name string + TypeName string + func (f FieldInfo) ContainsFlag(flag int) bool + func (f FieldInfo) String() string + func (finfo *FieldInfo) DerefIndirect(v interface{}) reflect.Value + func (finfo *FieldInfo) Value(v reflect.Value) reflect.Value + type FillMode string + type Filter struct + Column string + Mode FilterMode + Value any + type FilterList []Filter + func (l *FilterList) Add(mode FilterMode, col string, val ...any) + type FilterMode string + type FormatType string + type FutureResult chan *response + func (r FutureResult) Done() bool + func (r FutureResult) Receive(ctx context.Context) error + type HttpError struct + Data string + Header http.Header + Request string + Status int + func IsErrHttp(err error) (HttpError, bool) + func (e HttpError) Error() string + type OrderType string + type Query struct + Path string + Query url.Values + Server string + func NewQuery() Query + func ParseQuery(s string) (Query, error) + 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 struct + Count int + Cursor string + Runtime time.Duration + func NewStreamResponse(header http.Header) (StreamResponse, error) + type TableQuery struct + Columns []string + Cursor uint64 + Filter FilterList + Format FormatType + Limit int + NoFail bool + Order OrderType + Prim bool + Query Query + Table string + Verbose bool + func NewTableQuery(c *Client, name string) *TableQuery[T] + func (p TableQuery[T]) Check() error + func (p TableQuery[T]) Url() string + 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 (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]) 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] + func (q TableQuery[T]) Run(ctx context.Context) (*TableQueryResult[T], error) + type TableQueryResult struct + func NewTableQueryResult(cols []string) *TableQueryResult[T] + func (r *TableQueryResult[T]) Cursor() uint64 + func (r *TableQueryResult[T]) Last() (t T) + func (r *TableQueryResult[T]) Len() int + func (r *TableQueryResult[T]) Rows() []T + func (r *TableQueryResult[T]) UnmarshalJSON(data []byte) error + type TypeInfo struct + Fields []FieldInfo + IsGoType bool + Name string + TagName string + func (t TypeInfo) Aliases() []string + func (t TypeInfo) FieldNames() []string + func (t TypeInfo) FilteredAliases(f int) []string + func (t TypeInfo) Find(name string) (FieldInfo, bool)