api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: ISC Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSearchRequest added in v0.1.0

func NewSearchRequest() *searchRequest

Types

type Application

type Application struct {
	ID                    string    `json:"id"`
	APIKey                string    `json:"api_key"`
	BillingSubscriptionID string    `json:"billing_subscription_id"`
	Environment           string    `json:"environment"`
	ExternalProvider      *string   `json:"external_provider"`
	InsertedAt            time.Time `json:"inserted_at"`
	LanguageType          *string   `json:"language_type"`
	LogLineFormat         string    `json:"log_line_format"`
	Name                  string    `json:"name"`
	OrganizationId        string    `json:"organization_id"`
	Slug                  string    `json:"slug"`
	SourceType            string    `json:"source_type"`
	Tags                  []string  `json:"tags"`
	UpdatedAt             time.Time `json:"updated_at"`
}

type Client

type Client struct {
	APIKey string
	Host   string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, apiKey string) *Client

func (*Client) CreateSQLQuery added in v0.1.0

func (c *Client) CreateSQLQuery(organizationID string, body string) (*SQLQuery, error)

func (*Client) GetOrganization added in v0.1.0

func (c *Client) GetOrganization(id string) (*Organization, error)

func (*Client) GetSQLQuery added in v0.1.0

func (c *Client) GetSQLQuery(id string) (*SQLQuery, error)

func (*Client) GetSQLQueryResults added in v0.1.0

func (c *Client) GetSQLQueryResults(id string, request *GetSQLQueryResultsRequest) ([]map[string]interface{}, string, error)

func (*Client) GetSavedView

func (c *Client) GetSavedView(id string) (*SavedView, error)

func (*Client) ListOrganizations

func (c *Client) ListOrganizations() ([]*Organization, error)

func (*Client) ListSQLQueries added in v0.1.0

func (c *Client) ListSQLQueries(request *ListSQLQueriesRequest) ([]*SQLQuery, error)

func (*Client) ListSavedViews

func (c *Client) ListSavedViews() ([]*SavedView, error)

func (*Client) ListSources added in v0.1.0

func (c *Client) ListSources() ([]*Application, error)

func (*Client) Request

func (c *Client) Request(method string, path string, query *url.Values, requestStruct interface{}, responseStruct interface{}) error

func (*Client) Search

func (c *Client) Search(request *searchRequest) ([]*LogLine, error)

func (*Client) SetLogger

func (c *Client) SetLogger(l Logger)

type Error added in v0.1.0

type Error struct {
	Message string `json:message`
}

type GetSQLQueryResultsRequest added in v0.2.0

type GetSQLQueryResultsRequest struct {
	MaxResults int    `json:"max_results"`
	NextToken  string `json:"next_token"`
}

type ListSQLQueriesRequest added in v0.1.0

type ListSQLQueriesRequest struct {
	Limit int    `json:"limit"`
	Sort  string `json:"sort"` // TODO maybe make this an "enum"
}

func NewListSQLQueriesRequest added in v0.1.0

func NewListSQLQueriesRequest() *ListSQLQueriesRequest

type LogLine

type LogLine struct {
	ID            string    `json:"id"`
	ApplicationID string    `json:"application_id"`
	Datetime      time.Time `json:"dt"`
	Level         string    `json:"level"`
	Message       string    `json:"message"`

	Fields map[string]interface{}
}

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

type Organization

type Organization struct {
	ID                    string    `json:"id"`
	APIKey                string    `json:"api_key"`
	BillingSubscriptionID string    `json:"billing_subscription_id"`
	Environment           string    `json:"environment"`
	ExternalProvider      *string   `json:"external_provider"`
	InsertedAt            time.Time `json:"inserted_at"`
	LanguageType          *string   `json:"language_type"`
	LogLineFormat         string    `json:"log_line_format"`
	Name                  string    `json:"name"`
	OrganizationID        string    `json:"organization_id"`
	Slug                  string    `json:"slug"`
	Tags                  []string  `json:"tags"`
	UpdatedAt             time.Time `json:"updated_at"`
}

type SQLQuery added in v0.1.0

type SQLQuery struct {
	ID                   string    `json:"id"`
	Body                 string    `json:"body"`
	BytesScanned         int       `json:"bytes_scanned"`
	FailureReason        string    `json:"failure_reason"`
	InsertedAt           time.Time `json:"inserted_at"`
	MillisecondsExecuted int       `json:"milliseconds_executed"`
	ResultsURL           string    `json:"results_url"`
	Status               string    `json:"status"`
}

type SavedView

type SavedView struct {
	ID              string      `json:"id"`
	ChartSettings   interface{} `json:"chart_settings"`
	ConsoleSettings struct {
		DtGte         *string  `json:"dt_gte"`
		DtLte         *string  `json:"dt_lte"`
		Facets        []string `json:"facets"`
		LogLineFormat string   `json:"log_line_format"`
		Query         *string  `json:"query"`
		SourceIds     []string `json:"source_ids"`
	} `json:"console_settings"`
	Name           string `json:"name"`
	OrganizationId string `json:"organization_id"`
	Type           string `json:"type"`
}

TODO fill out chart settings

type ServiceError added in v0.1.0

type ServiceError struct {
	StatusCode  int
	ErrorStruct *Error
}

func (*ServiceError) Error added in v0.1.0

func (e *ServiceError) Error() string

Jump to

Keyboard shortcuts

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