Documentation
¶
Overview ¶
Package client provides a client for the FancyAnalytics API.
Index ¶
Constants ¶
View Source
const ( DefaultBaseURL = "http://fancyanalytics.net" DefaultMaxIdleConnections = 100 DefaultIdleTimeout = 90 * time.Second DefaultTimeout = 30 * time.Second )
Variables ¶
View Source
var ( ErrNoProjectID = errors.New("no project ID provided") ErrUnexpectedStatusCode = errors.New("unexpected status code") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the FancyAnalytics API.
var DefaultClient *Client
func New ¶
func New(cfg Configuration) (*Client, error)
New creates a new FancyAnalytics client with the given configuration.
func (*Client) SendRecord ¶
func (c *Client) SendRecord(records []RecordData) error
type Configuration ¶
type Configuration struct {
// BaseURL is the base URL of the FancyAnalytics API.
// If empty, DefaultBaseURL is used.
BaseURL string
// SenderID is the sender ID to use for requests.
// If empty a random UUID will be used.
SenderID string
// AuthToken is the authentication token to use for requests. Optional.
AuthToken string
// ProjectID is the project ID to use for requests.
ProjectID string
// WriteKey is the write key for the project. Optional.
WriteKey string
// MaxIdleConnections sets the maximum number of idle (keep-alive) connections across all hosts.
// If zero, DefaultMaxIdleConnections is used.
MaxIdleConnections int
// IdleConnectionTimeout is the maximum amount of time an idle (keep-alive) connection will remain idle before closing itself.
// If zero, DefaultIdleTimeout is used.
IdleConnectionTimeout time.Duration
// RequestTimeout is the maximum amount of time a request can take before timing out.
// If zero, DefaultTimeout is used.
RequestTimeout time.Duration
}
Configuration holds the configuration for the FancyAnalytics client.
type Event ¶
func (*Event) WithProperty ¶
type RecordData ¶
Click to show internal directories.
Click to hide internal directories.