devo

module
v0.0.0-...-795ddc4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT

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)
        }

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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