logentries

package module
v0.0.0-...-00bd93f Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: MIT Imports: 5 Imported by: 64

README

Logentries client (golang)

Provides the capability to perform CRUD operations on log sets, logs, and log types.

Example

package main

import (
   "fmt"
   logentries "github.com/logentries/le_goclient"
)

func main() {
   client := logentries.NewClient("<account_key>")
   res, err := client.User.Read(logentries.UserReadRequest{})
   fmt.Printf("err: %s\n", err)
   fmt.Println(res)
}

License

See LICENSE.md

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiObject

type ApiObject struct {
	Object string `json:"object"`
}

type ApiResponse

type ApiResponse struct {
	Response       string `json:"response"`
	ResponseReason string `json:"reason"`
	Worker         string `json:"worker"`
	Id             string `json:"id"`
}

type Client

type Client struct {
	Log     *LogClient
	LogSet  *LogSetClient
	User    *UserClient
	LogType *LogTypeClient
}

func NewClient

func NewClient(account_key string) *Client

type Log

type Log struct {
	Name      string `json:"name"`
	Created   int64  `json:"created"`
	Key       string `json:"key"`
	Token     string `json:"token"`
	Follow    string `json:"follow"`
	Retention int64  `json:"retention"`
	Source    string `json:"type"`
	Type      string `json:"logtype"`
	Filename  string `json:"filename"`
	ApiObject
}

type LogClient

type LogClient struct {
	AccountKey string
}

func NewLogClient

func NewLogClient(account_key string) *LogClient

func (*LogClient) Create

func (l *LogClient) Create(createRequest LogCreateRequest) (*Log, error)

func (*LogClient) Delete

func (l *LogClient) Delete(deleteRequest LogDeleteRequest) error

func (*LogClient) Read

func (l *LogClient) Read(readRequest LogReadRequest) (*Log, error)

func (*LogClient) Update

func (l *LogClient) Update(updateRequest LogUpdateRequest) (*Log, error)

type LogCreateRequest

type LogCreateRequest struct {
	LogSetKey string
	Name      string
	Retention string
	Source    string
	Type      string
	Filename  string
}

type LogCreateResponse

type LogCreateResponse struct {
	Key    string `json:"log_key"`
	Worker string `json:"worker"`
	Log    Log    `json:"log"`
	ApiResponse
}

type LogDeleteRequest

type LogDeleteRequest struct {
	LogSetKey string
	Key       string
}

type LogDeleteResponse

type LogDeleteResponse struct {
	LogSetKey string `json:"host_key"`
	UserKey   string `json:"user_key"`
	Key       string `json:"log_key"`
	Worker    string `json:"worker"`
	ApiResponse
}

type LogReadRequest

type LogReadRequest struct {
	LogSetKey string
	Key       string
}

type LogReadResponse

type LogReadResponse struct {
	Log Log `json:"log"`
	ApiResponse
}

type LogSet

type LogSet struct {
	Distver  string `json:"distver"`
	C        int64  `json:"c"`
	Name     string `json:"name"`
	Distname string `json:"distname"`
	Location string `json:"hostname"`
	Key      string `json:"key"`
	Logs     []Log
	ApiObject
}

type LogSetClient

type LogSetClient struct {
	AccountKey string
}

func NewLogSetClient

func NewLogSetClient(account_key string) *LogSetClient

func (*LogSetClient) Create

func (l *LogSetClient) Create(createRequest LogSetCreateRequest) (*LogSet, error)

func (*LogSetClient) Delete

func (l *LogSetClient) Delete(deleteRequest LogSetDeleteRequest) error

func (*LogSetClient) Read

func (l *LogSetClient) Read(readRequest LogSetReadRequest) (*LogSet, error)

func (*LogSetClient) Update

func (l *LogSetClient) Update(updateRequest LogSetUpdateRequest) (*LogSet, error)

type LogSetCreateRequest

type LogSetCreateRequest struct {
	Name     string
	Location string
	DistVer  string
	System   string
	DistName string
}

type LogSetCreateResponse

type LogSetCreateResponse struct {
	AgentKey string `json:"agent_key"`
	HostKey  string `json:"host_key"`
	LogSet   `json:"host"`
	ApiResponse
}

type LogSetDeleteRequest

type LogSetDeleteRequest struct {
	Key string
}

type LogSetDeleteResponse

type LogSetDeleteResponse struct {
	UserKey string `json:"user_key"`
	Key     string `json:"host_key"`
	Worker  string `json:"worker"`
	ApiResponse
}

type LogSetReadRequest

type LogSetReadRequest struct {
	Key  string
	Name string
}

type LogSetReadResponse

type LogSetReadResponse struct {
	LogSet LogSet
	ApiResponse
}

type LogSetUpdateRequest

type LogSetUpdateRequest struct {
	Key      string
	Name     string
	Location string
}

type LogSetUpdateResponse

type LogSetUpdateResponse struct {
	AgentKey string `json:"agent_key"`
	Key      string `json:"host_key"`
	LogSet   `json:"host"`
	ApiResponse
}

type LogType

type LogType struct {
	Title       string `json:"title"`
	Description string `json:"desc"`
	Key         string `json:"key"`
	Shortcut    string `json:"shortcut"`
	ApiObject
}

type LogTypeClient

type LogTypeClient struct {
	AccountKey string
}

func NewLogTypeClient

func NewLogTypeClient(account_key string) *LogTypeClient

func (*LogTypeClient) Read

func (u *LogTypeClient) Read(defaultLogTypeListRequest LogTypeListRequest) ([]LogType, error)

func (*LogTypeClient) ReadDefault

func (u *LogTypeClient) ReadDefault(defaultLogTypeListRequest LogTypeListRequest) ([]LogType, error)

type LogTypeListRequest

type LogTypeListRequest struct {
}

type LogTypeListResponse

type LogTypeListResponse struct {
	List []LogType
	ApiResponse
}

type LogUpdateRequest

type LogUpdateRequest struct {
	Key       string
	Name      string
	Type      string
	Source    string
	Retention string
	Filename  string
}

type LogUpdateResponse

type LogUpdateResponse struct {
	Key    string `json:"log_key"`
	Worker string `json:"worker"`
	Log    Log    `json:"log"`
	ApiResponse
}

type User

type User struct {
	UserKey string        `json:"user_key"`
	LogSets []LogSet      `json:"hosts"`
	Apps    []interface{} `json:"apps"`
	Logs    []interface{} `json:"logs"`
}

type UserClient

type UserClient struct {
	UserKey string
}

func NewUserClient

func NewUserClient(account_key string) *UserClient

func (*UserClient) Read

func (u *UserClient) Read(readRequest UserReadRequest) (*UserReadResponse, error)

type UserReadRequest

type UserReadRequest struct {
}

type UserReadResponse

type UserReadResponse struct {
	User
	ApiResponse
}

Jump to

Keyboard shortcuts

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