fullstory

package module
v0.0.0-...-272735d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2019 License: MIT Imports: 8 Imported by: 0

README

fullstory

wercker status GoDoc Coverage Status

Package fullstory implements a client for the fullstory.com API.

It's untested with the live API. Please create an issue if it does not work.

Docs

See godoc.

Test

go test -race 

Example

package main

import (
	"fmt"
	"log"

	"github.com/nishanths/fullstory"
)

func main() {
	client := fullstory.NewClient("API token")

	s, err := client.Sessions(15, "foo", "hikingfan@gmail.com")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(s)
}

License

MIT.

Documentation

Overview

Package fullstory implements a HTTP client to communicate with the fullstory.com API.

For the API definition, see:

http://help.fullstory.com/develop-rest
Example (Usage)
package main

import (
	"fmt"
	"log"

	"github.com/nishanths/fullstory"
)

func main() {
	client := fullstory.NewClient("API token")

	s, err := client.Sessions(15, "foo", "hikingfan@gmail.com")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(s)
}
Output:

Index

Examples

Constants

View Source
const BaseURL = "https://export.fullstory.com/api/v1"

BaseURL is the base URL for the fullstory.com API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	Config
}

Client represents a HTTP client for making requests to the FullStory API.

func NewClient

func NewClient(apiToken string) *Client

NewClient returns a Client initialized with http.DefaultClient and the supplied apiToken.

func (*Client) ExportData

func (c *Client) ExportData(id int, modifyReq ...func(r *http.Request)) (ExportData, error)

ExportData returns the data export bundle specified by id.

If the client's HTTP Transport has DisableCompression set to true, the caller should treat the returned ExportData as gzipped JSON. Otherwise, ExportData is JSON that has already been uncompressed.

The caller is responsible for closing the returned ExportData if the returned error is nil.

func (*Client) ExportList

func (c *Client) ExportList(start time.Time) ([]ExportMeta, error)

ExportList returns a list of metadata on completed data export bundles.

func (*Client) Sessions

func (c *Client) Sessions(limit int, uid, email string) ([]Session, error)

Sessions returns a list of Session for the supplied parameters. If limit == -1, limit is ignored.

For more details, see:

http://help.fullstory.com/develop-rest/137382-rest-api-retrieving-a-list-of-sessions-for-a-given-user-after-the-fact

type Config

type Config struct {
	APIToken string
	BaseURL  string
}

Config is configuration for Client.

type ExportData

type ExportData io.ReadCloser

ExportData represents data from the "/export/get" endpoint.

For more details, see:

http://help.fullstory.com/develop-rest/data-export-api

type ExportMeta

type ExportMeta struct {
	Start time.Time
	Stop  time.Time
	ID    int
}

ExportMeta is metadata about ExportData.

func (*ExportMeta) UnmarshalJSON

func (em *ExportMeta) UnmarshalJSON(data []byte) error

type Session

type Session struct {
	UserID    int
	SessionID int
	Created   time.Time
	URL       string
}

Session represents the FullStory session for a user.

func (*Session) UnmarshalJSON

func (s *Session) UnmarshalJSON(data []byte) error

type StatusError

type StatusError struct {
	Status     string
	StatusCode int
	RetryAfter time.Duration
	Body       io.Reader
}

StatusError is returned when the HTTP roundtrip succeeds, but the response status does not equal http.StatusOK.

func (StatusError) Error

func (e StatusError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL