logs

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PoolingInterval = time.Second

PoolingInterval is the time between retries

View Source
var SeverityToLevel = map[string]int{
	"critical": 2,
	"error":    3,
	"warning":  4,
	"info":     6,
	"debug":    7,
}

SeverityToLevel map

Functions

func GetLevel

func GetLevel(severityOrLevel string) (int, error)

GetLevel to get level from severity or itself

func GetUnixTimestamp

func GetUnixTimestamp(since string) (int64, error)

GetUnixTimestamp gets the Unix timestamp in seconds from a friendly string. Be aware that the dashboard is using ms, not s.

func Watch

func Watch(wectx config.Context, watcher *Watcher)

Watch logs

Types

type Client added in v1.1.5

type Client struct {
	*apihelper.Client
}

Client for the services

func New added in v1.1.5

func New(wectx config.Context) *Client

New Client

func (*Client) GetList added in v1.1.5

func (c *Client) GetList(ctx context.Context, filter *Filter) ([]Log, error)

GetList logs

func (*Client) List added in v1.1.5

func (c *Client) List(ctx context.Context, filter *Filter) error

List logs

type Filter

type Filter struct {
	Project  string `json:"-"`
	Service  string `json:"serviceId,omitempty"`
	Instance string `json:"containerUid,omitempty"`
	Level    int    `json:"level,omitempty"`
	Since    string `json:"start,omitempty"`
}

Filter structure

type Log

type Log struct {
	ServiceID    string `json:"serviceId"`
	ContainerUID string `json:"containerUid"`
	Build        bool   `json:"build"`
	DeployUID    string `json:"deployUid"`
	ProjectID    string `json:"projectId"`
	Level        int    `json:"level"`
	Message      string `json:"message"`
	Severity     string `json:"severity"`
	Timestamp    string `json:"timestamp"`
}

Log structure

type Watcher

type Watcher struct {
	Client          *Client
	Filter          *Filter
	PoolingInterval time.Duration
	// contains filtered or unexported fields
}

Watcher structure

func (*Watcher) Start

func (w *Watcher) Start(wectx config.Context)

Start for Watcher

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop for Watcher

Jump to

Keyboard shortcuts

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