Documentation ¶
Index ¶
- Constants
- type Datastore
- func (d *Datastore) DeleteData(ctx context.Context, req *datastore.DeleteRequest) (*datastore.DeleteResponse, error)
- func (d *Datastore) ReadData(ctx context.Context, req *datastore.ReadRequest) (*datastore.ReadResponse, error)
- func (d *Datastore) Start() error
- func (d *Datastore) Stop() error
- func (d *Datastore) WriteData(ctx context.Context, req *datastore.WriteRequest) (*datastore.WriteResponse, error)
Constants ¶
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 ¶
Datastore is our implementation of the generated twirp interface for the encrypted datastore.
func NewDatastore ¶
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) DeleteData ¶
func (d *Datastore) DeleteData(ctx context.Context, req *datastore.DeleteRequest) (*datastore.DeleteResponse, error)
DeleteData is our handler function that allows a client to delete data for a specific user.
func (*Datastore) ReadData ¶
func (d *Datastore) ReadData(ctx context.Context, req *datastore.ReadRequest) (*datastore.ReadResponse, error)
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) WriteData ¶
func (d *Datastore) WriteData(ctx context.Context, req *datastore.WriteRequest) (*datastore.WriteResponse, error)
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.