rpc

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPageSize is the default page size we use when reading data from the
	// datastore.
	DefaultPageSize = 500

	// MaxPageSize is the maximum page size we allow clients to request when
	// reading data from the datastore.
	MaxPageSize = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	DB *postgres.DB
	// contains filtered or unexported fields
}

Datastore is our implementation of the generated twirp interface for the encrypted datastore.

func NewDatastore

func NewDatastore(db *postgres.DB, verbose bool, logger kitlog.Logger) *Datastore

NewDatastore returns a newly instantiated Datastore instance. It takes as parameters a DB connection string and a logger. The connection string is passed down to the postgres package where it is used to connect.

func (*Datastore) ReadData

ReadData is the handler that allows a client to request data from the datastore matching search parameters defined in the incoming datastore.ReadRequest object.

func (*Datastore) Start

func (d *Datastore) Start() error

Start starts all child components (here just the postgres DB).

func (*Datastore) Stop

func (d *Datastore) Stop() error

Stop stops all child components.

func (*Datastore) WriteData

WriteData is the method by which data is written into the datastore. It accepts a context, and a WriteRequest object containing the data. Provided the incoming request object is valid, then an event will be written into the database. Any invalid data will return an error.

Jump to

Keyboard shortcuts

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