csvdb

package
v0.0.0-...-0b164cc Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	s3iface.S3API
	// contains filtered or unexported fields
}

Client represents the struct used to make queries to an s3 csv

func NewClient

func NewClient(s s3iface.S3API, bucket, key string) *Client

NewClient instantiates a new client struct

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, filters ...Filter) ([]map[string]string, error)

QueryContext is used to make a select query agains the CSV in S3

func (*Client) QueryRawContext

func (c *Client) QueryRawContext(ctx context.Context, query string, useHeader bool) ([]map[string]string, error)

QueryRawContext uses a raw string query to call s3select on a resource

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter is a key/value pair used for the where clause. could have used

func NewFilter

func NewFilter(k, v string) Filter

NewFilter creates a new filter foa key value pair

type Row

type Row struct {
	ID        string `json:"policyID"`
	StateCode string `json:"statecode"`
	County    string `json:"county"`
}

Row is one record in the csv

Jump to

Keyboard shortcuts

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