Golang module to work with Devo (https://www.devo.com/)
Package with tools and helper functions to run LinQ queries using Devo API V2. See Build a query using LINQ
See next code examples:
- querytoken.go Query to Devo authenticated with token
Package with tools to send data to Devo to central relay or through relay-in-house.
On one hand there are two main interfaces to get an abstraction of sender events:
DevoSender
: This interface defines the basic element to send events to Devo or relay in-house.SwitchDevoSender
: This interface defines and element that send events to Devo but can be paused (cancel and close connection to relay in-house) withStandBy
function and reconnect again withWakeUp
function. Events that are send usingSendXXXAxync
functions while sender is in stand by mode must be conserved by each implementation in order to be sent when sender leave this stand by mode. If the user call noAsync
functions to send events during stand by mode period, error will be returned.
On the other hand we have three main implementations or Clients that are the engine that send data to Devo (or relay):
-
Client
type. It is in an implementation ofDevoSender
interface. Recommended way to instate it is usingClientBuilder
that follows Builder pattern. The recommended way to instantiateClientBuilder
is usingNewClientBuilder
factory function. -
LazyClient
type. It is in an implementation ofSwitchDevoSender
interface. Recommended way to instate it is usingLazyClientBuilder
that follows Builder pattern. The recommended way to instantiateLazyClientBuilder
is usingNewLazyClientBuilder
factory function.Events send with
SendXXXAsync
functions during stand by mode are saved in a memory buffer. These events will be send whenWakeUp
orClose
functions are called. -
ReliableClient
type. It is in an implementation ofSwitchDevoSender
interface. Recommended way to instate it is usingReliableClientBuilder
that follows Builder pattern. The recommended way to instantiateReliableClientBuilder
is usingNewReliableClientBuilder
factory function.This component save all events send with
SendXXXAsync
functions in a persistence layer on disk. Those events will be re-send when client is not in stand by mode by an internal Daemon without any direct user action.The client support recover the status from disk if client is stopped (abruptly or not) and started again. Events that returned error will be tried to resend too. The max number of events to save on disk are defined by two parameters set with builder functions:
-
EventTimeToLiveInSeconds
That defines the expiration time, in seconds, of the event (max time to live in the status) -
BufferEventsSize
. Defines the max number of the events to get in the status at same time.
-
See go doc for more info.
This projecet include a set of examples to guide as introduction to the main components:
- senderclientclean.go Example to send data to Devo relay-in house
- sendercentralrelay.go Example to send data to Devo central relay
- senderasync.go Example to send data to Devo relay-in house in asynchronous mode
- senderfileasevent.go Example to send content of a file as only one event to Devo relay-in house. Using
io.Copy
func - sendercentralrelaywithbuilder.go Example to send data to Devo central relay but instantiating client using
ClientBuilder
- sendercentralrelaytimeout.go Example to send data to Devo central relay that you can set TCP connection timeout based on
ClientBuilder
option - sendercentralrelaykeepalive.go Example to send data to Devo central relay but setting TCP keep-alive time based on
ClientBuilder
option - sendercentralrelayrecreatecon.go Example to send data to Devo central relay but set to recreate connection if time from last event sent is greater than threshold. This value is set using
ClientBuilder
option.
See ./examples for more example files.
Package to abstract a Key Value structure (log table) using Devo tables as a persistence.
See next code examples:
- logtable.go Example to add, delete, get and dump values using
logtable
abstraction - logtable_batch.go Example to add/set a batch of values in a
logtable
- logtable_prefixnames.go Example to list and optionally delete a batch of values in a
logtable
See ./examples for more example files.
To run examples you need to get Golang installed and configured. See Golang official site for more info.
Then you can run examples executing next line at root project path:
go run examples/EXAMPLE_FILE.go
And follow simple help displayed in case of required parameters