devo-go

module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT

README

devo-go

Golang module to work with Devo (https://www.devo.com/)

Packages in module

devoquery

Package with tools and helper functions to run LinQ queries using Devo API V2. See Build a query using LINQ

See next code examples:

devosender

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) with StandBy function and reconnect again with WakeUp function. Events that are send using SendXXXAxync 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 no Async 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 of DevoSender interface. Recommended way to instate it is using ClientBuilder that follows Builder pattern. The recommended way to instantiate ClientBuilder is using NewClientBuilder factory function.

  • LazyClient type. It is in an implementation of SwitchDevoSender interface. Recommended way to instate it is using LazyClientBuilder that follows Builder pattern. The recommended way to instantiate LazyClientBuilder is using NewLazyClientBuilder factory function.

    Events send with SendXXXAsync functions during stand by mode are saved in a memory buffer. These events will be send when WakeUp or Close functions are called.

  • ReliableClient type. It is in an implementation of SwitchDevoSender interface. Recommended way to instate it is using ReliableClientBuilder that follows Builder pattern. The recommended way to instantiate ReliableClientBuilder is using NewReliableClientBuilder 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:

See ./examples for more example files.

devologtable

Package to abstract a Key Value structure (log table) using Devo tables as a persistence.

See next code examples:

See ./examples for more example files.

Running examples

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

Directories

Path Synopsis
Package applogger define a set of simple logger interfaces that can be implement by the libraries client and that it should be used in all devo-go libraries
Package applogger define a set of simple logger interfaces that can be implement by the libraries client and that it should be used in all devo-go libraries
Package devologtable implements the tools to use data saved in Devo (under certain tag) like a Table.
Package devologtable implements the tools to use data saved in Devo (under certain tag) like a Table.
Package devoquery implements the tools to load data running queries to Devo in a different ways and scenarios
Package devoquery implements the tools to load data running queries to Devo in a different ways and scenarios
Package devosender implements the tools to send data to Devo in a different ways and scenarios
Package devosender implements the tools to send data to Devo in a different ways and scenarios

Jump to

Keyboard shortcuts

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