devo

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 12 Imported by: 0

README

devo

##Simple Query

package main

import (
        "log"
        "time"
        "github.com/GolangResources/devo/v1"
)

const (
                LAYOUT = "2006-01-02 15:04:05"
)

func main() {
        dateFrom, _ := time.Parse(LAYOUT, "2020-02-10 15:30:00")
        dateTo, _ := time.Parse(LAYOUT, "2020-02-10 18:36:00")
        devoConf := devo.DevoClient{
                APIKey: "",
                APISecret: "",
                SerreaURL: "https://serreaurl.devo.com/v2/search/query",
                Debug: false,
                BufferSize: 4096,
        }
        d := devo.Init(&devoConf)
        resultmsg := make(chan string, 4096)
        go d.QueryRaw(dateFrom.Unix(), dateTo.Unix(), "from app.apache.access select * where message -> \"favicon.ico\"", resultmsg)
        for msg := range resultmsg {
                log.Println(msg)
        }

##Continuous Query

package main

import (
        "log"
        "time"
        "github.com/GolangResources/devo/v1"
)

const (
                LAYOUT = "2006-01-02 15:04:05"
)

func main() {
        dateFrom, _ := time.Parse(LAYOUT, "2020-02-10 15:30:00")
        devoConf := devo.DevoClient{
                APIKey: "",
                APISecret: "",
                SerreaURL: "https://serreaurl.devo.com/v2/search/query",
                Debug: false,
                BufferSize: 4096,
        }
        d := devo.Init(&devoConf)
        resultmsg := make(chan string, 4096)
        go d.ContinuousQuery(dateFrom.Unix(), "from app.apache.access select * where message -> \"favicon.ico\"", resultmsg)
        for msg := range resultmsg {
                log.Println(msg)
        }

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG = os.Getenv("DEBUG")

Functions

This section is empty.

Types

type DevoClient

type DevoClient struct {
	// contains filtered or unexported fields
}

func NewDevoClient

func NewDevoClient(apiKey, apiSecret, url string) *DevoClient

func (*DevoClient) DevoQuery

func (client *DevoClient) DevoQuery(dateFromStr, dateToStr, query string, eventChan chan<- Event, errChan chan<- error)

type Event

type Event map[string]interface{}

Jump to

Keyboard shortcuts

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