provider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQueryProvider

type BigQueryProvider struct {
	// Client with the client to connect to bigquery
	Client *bigquery.Client

	// BigQueryConfig with all the configuration (schema, table, etc.)
	config.BigQueryConfig

	// Cache with a cache of operation data
	// in this cache we store the operations to avoid send msg by msg
	Cache []entities.Operation
	// Mutex for managing login cache access.
	sync.Mutex
}

BigQueryProvider with a provider that stores the operation information in bigquery

func (*BigQueryProvider) Flush

func (bq *BigQueryProvider) Flush() error

func (*BigQueryProvider) LaunchSendingLoop

func (bq *BigQueryProvider) LaunchSendingLoop()

LaunchSendingLoop launch a loop to insert the cache data in the database

func (*BigQueryProvider) Send

func (bq *BigQueryProvider) Send(operation entities.Operation) error

Send stores the operation information in a cache

func (*BigQueryProvider) SendCacheOperation

func (bq *BigQueryProvider) SendCacheOperation() error

SendCacheOperation inserts all the operations in the database

type Provider

type Provider interface {
	// Send inserts the data in the database
	Send(data entities.Operation) error
	// Flush flush the data
	Flush() error
}

Provider with an interface that defines the monitoring provider methods

func NewBigQueryProvider

func NewBigQueryProvider(cfg config.BigQueryConfig) (Provider, error)

NewBigQueryProvider

Jump to

Keyboard shortcuts

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