Versions in this module Expand all Collapse all v3 v3.0.0 Nov 12, 2024 Changes in this version + const EndpointDefault + const EndpointLocal + const EnvFaunaDebug + const EnvFaunaEndpoint + const EnvFaunaSecret + const HeaderLastTxnTs + const HeaderLinearized + const HeaderMaxContentionRetries + const HeaderQueryTimeoutMs + const HeaderTags + const HeaderTraceparent + const HeaderTypecheck + type Client struct + func NewClient(secret string, timeouts Timeouts, configFns ...ClientConfigFn) *Client + func NewDefaultClient() (*Client, error) + func (c *Client) Feed(stream EventSource, opts ...FeedOptFn) (*EventFeed, error) + func (c *Client) FeedFromQuery(query *Query, opts ...FeedOptFn) (*EventFeed, error) + func (c *Client) GetLastTxnTime() int64 + func (c *Client) Paginate(fql *Query, opts ...QueryOptFn) *QueryIterator + func (c *Client) Query(fql *Query, opts ...QueryOptFn) (*QuerySuccess, error) + func (c *Client) SetLastTxnTime(txnTime time.Time) + func (c *Client) Stream(stream EventSource, opts ...StreamOptFn) (*EventStream, error) + func (c *Client) StreamFromQuery(fql *Query, streamOpts []StreamOptFn, opts ...QueryOptFn) (*EventStream, error) + func (c *Client) String() string + type ClientConfigFn func(*Client) + func AdditionalHeaders(headers map[string]string) ClientConfigFn + func Context(ctx context.Context) ClientConfigFn + func DefaultTypecheck(enabled bool) ClientConfigFn + func HTTPClient(client *http.Client) ClientConfigFn + func Linearized(enabled bool) ClientConfigFn + func MaxAttempts(attempts int) ClientConfigFn + func MaxBackoff(backoff time.Duration) ClientConfigFn + func MaxContentionRetries(i int) ClientConfigFn + func QueryTags(tags map[string]string) ClientConfigFn + func QueryTimeout(d time.Duration) ClientConfigFn + func URL(url string) ClientConfigFn + func WithLogger(logger Logger) ClientConfigFn + type ClientLogger struct + func (d ClientLogger) Debug(msg string, args ...any) + func (d ClientLogger) Error(msg string, args ...any) + func (d ClientLogger) Info(msg string, args ...any) + func (d ClientLogger) LogResponse(ctx context.Context, requestBody []byte, r *http.Response) + func (d ClientLogger) Warn(msg string, args ...any) + type Document struct + Coll *Module + Data map[string]any + ID string + TS *time.Time + type ErrAbort struct + func (e *ErrAbort) Unmarshal(into any) error + type ErrAuthentication struct + type ErrAuthorization struct + type ErrConstraintFailure struct + Message string + Name string + Paths []any + type ErrContendedTransaction struct + type ErrEvent struct + Abort any + Code string + Message string + func (e *ErrEvent) Error() string + func (e *ErrEvent) Unmarshal(into any) error + type ErrFauna struct + Abort any + Code string + ConstraintFailures []ErrConstraintFailure + Message string + StatusCode int + func (e ErrFauna) Error() string + type ErrInvalidRequest struct + type ErrNetwork error + type ErrQueryCheck struct + type ErrQueryRuntime struct + type ErrQueryTimeout struct + type ErrServiceInternal struct + type ErrServiceTimeout struct + type ErrThrottling struct + type Event struct + Cursor string + Data any + Stats Stats + TxnTime int64 + Type EventType + func (e *Event) Unmarshal(into any) error + type EventFeed struct + func (ef *EventFeed) Next(page *FeedPage) error + type EventSource string + type EventStream struct + func (es *EventStream) Close() (err error) + func (es *EventStream) Next(event *Event) (err error) + type EventType string + const AddEvent + const RemoveEvent + const StatusEvent + const UpdateEvent + type FeedOptFn func(req *feedOptions) + func EventFeedCursor(cursor string) FeedOptFn + func EventFeedPageSize(ts int) FeedOptFn + func EventFeedStartTime(ts time.Time) FeedOptFn + func EventFeedStartTimeUnixMicros(ts int64) FeedOptFn + type FeedPage struct + Cursor string + Events []Event + HasNext bool + Stats Stats + type Logger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Info func(msg string, args ...any) + LogResponse func(ctx context.Context, requestBody []byte, r *http.Response) + Warn func(msg string, args ...any) + func DefaultLogger() Logger + type Module struct + Name string + type NamedDocument struct + Coll *Module + Data map[string]any + Name string + TS *time.Time + type NamedRef struct + Coll *Module + Name string + type NullDocument struct + Cause string + Ref *Ref + type NullNamedDocument struct + Cause string + Ref *NamedRef + type Page struct + After string + Data []any + func (p Page) Unmarshal(into any) error + type Query struct + func FQL(query string, args map[string]any) (*Query, error) + type QueryInfo struct + QueryTags map[string]string + SchemaVersion int64 + Stats *Stats + Summary string + TxnTime int64 + type QueryIterator struct + func (q *QueryIterator) HasNext() bool + func (q *QueryIterator) Next() (*Page, error) + type QueryOptFn func(req *queryRequest) + func QueryContext(ctx context.Context) QueryOptFn + func Tags(tags map[string]string) QueryOptFn + func Timeout(dur time.Duration) QueryOptFn + func Traceparent(id string) QueryOptFn + func Typecheck(enabled bool) QueryOptFn + type QuerySuccess struct + Data any + StaticType string + func (r *QuerySuccess) Unmarshal(into any) error + type Ref struct + Coll *Module + ID string + type Stats struct + Attempts int + ComputeOps int + ContentionRetries int + ProcessingTimeMs *int + QueryTimeMs int + ReadOps int + StorageBytesRead int + StorageBytesWrite int + WriteOps int + type StreamOptFn func(req *streamRequest) + func EventCursor(cursor string) StreamOptFn + func StreamStartTime(ts time.Time) StreamOptFn + func StreamStartTimeUnixMicros(ts int64) StreamOptFn + type Timeouts struct + ClientBufferTimeout time.Duration + ConnectionTimeout time.Duration + IdleConnectionTimeout time.Duration + QueryTimeout time.Duration + func DefaultTimeouts() Timeouts Other modules containing this package github.com/fauna/fauna-go github.com/fauna/fauna-go/v2