Documentation ¶
Overview ¶
Package bqfake provides tools to construct fake bigquery datasets, tables, query responses, etc.
Index ¶
- type Client
- type ClientConfig
- type CountingTransport
- type Dataset
- type Job
- type Query
- type QueryConfig
- type RowIterator
- type RowIteratorConfig
- type Table
- func (tbl Table) Create(ctx context.Context, meta *bigquery.TableMetadata) error
- func (tbl Table) DatasetID() string
- func (tbl Table) FullyQualifiedName() string
- func (tbl Table) Metadata(ctx context.Context) (*bigquery.TableMetadata, error)
- func (tbl Table) ProjectID() string
- func (tbl Table) TableID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client implements a fake client.
func NewClient ¶
NewClient creates a new Client implementing bqiface.Client, with a dry run HTTPClient.
func NewQueryReadClient ¶ added in v0.1.20
func NewQueryReadClient(qc QueryConfig) *Client
type ClientConfig ¶ added in v0.1.20
type ClientConfig struct {
QueryConfig
}
ClientConfig contains configuration for injecting result and error values.
type CountingTransport ¶
type CountingTransport struct {
// contains filtered or unexported fields
}
CountingTransport counts calls, and returns OK and empty body. `count` field should only be accessed using atomic.Foobar
func DryRunClient ¶
func DryRunClient() (*http.Client, *CountingTransport)
DryRunClient returns a client that just counts calls.
func (*CountingTransport) Count ¶
func (ct *CountingTransport) Count() int32
Count returns the client call count.
func (*CountingTransport) Requests ¶
func (ct *CountingTransport) Requests() []*http.Request
Requests returns the entire req from the last request
type Query ¶
Query implements parts of bqiface.Query to allow some very basic unit tests.
func (Query) SetQueryConfig ¶
func (q Query) SetQueryConfig(bqiface.QueryConfig)
type QueryConfig ¶ added in v0.1.20
type QueryConfig struct { ReadErr error RowIteratorConfig }
QueryConfig contains configuration for injecting query results and error values.
type RowIterator ¶
type RowIterator struct { bqiface.RowIterator // contains filtered or unexported fields }
func (*RowIterator) Next ¶
func (r *RowIterator) Next(dst interface{}) error
type RowIteratorConfig ¶ added in v0.1.20
RowIteratorConfig contains configuration for injecting row iteration results and error values.
type Table ¶
Table implements part of the bqiface.Table interface required for basic testing Other parts of the interface should be implemented as needed.
func (Table) FullyQualifiedName ¶
FullyQualifiedName implements the bqiface method.