client

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEventsInput

type AddEventsInput struct {
	// ProjectID is the project id.
	ProjectID string `json:"project_id"`

	// Events is the batch of events.
	Events []Event `json:"events"`
}

AddEventsInput params.

type Client

type Client struct {
	URL       string
	AuthToken string
}

Client is the API client.

func (*Client) AddEvents

func (c *Client) AddEvents(in AddEventsInput) error

AddEvents ingested a batch of events.

type Error

type Error struct {
	Method     string
	Status     string
	StatusCode int
	Type       string
	Message    string
}

Error is an error returned by the client.

func (Error) Error

func (e Error) Error() string

Error implementation.

type Event

type Event struct {
	// ID is the event id.
	ID string `json:"id"`

	// Level is the severity level.
	Level string `json:"level"`

	// Message is the log message.
	Message string `json:"message"`

	// Fields is the log fields.
	Fields map[string]interface{} `json:"fields"`

	// Timestamp is the creation timestamp.
	Timestamp time.Time `json:"timestamp"`
}

Event represents a single log event.

Jump to

Keyboard shortcuts

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