btrefresh

package
v0.1.10-0...-786caa0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BtDialer

type BtDialer func() (*bigtable.Client, error)

BtDialer encapsulates making a connection to your bigtable. This way you can use any means for dialing/ getting credentials.

type RotatingTable

type RotatingTable struct {
	*bigtable.Table
	// contains filtered or unexported fields
}

RotatingTable is a bigtable.Table that automatically reconnects to Cloud Bigtable at a given interval.

func NewRotatingTable

func NewRotatingTable(dialer BtDialer, table string, refresh time.Duration) (*RotatingTable, error)

NewRotatingTable makes a new Table reference that will refresh itself in the background at the given interval.

func (RotatingTable) BackgroundErrors

func (r RotatingTable) BackgroundErrors() <-chan error

BackgroundErrors is a channel that will propagate errors that come from refreshing the connection. It can either be checked with select before performing ops or watched in a background thread.

func (RotatingTable) Close

func (r RotatingTable) Close()

Close will close the connections and stop rotating.

Jump to

Keyboard shortcuts

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