bigquery

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobStats

type JobStats struct {
	// BytesProcessed is the total bytes processed by the query.
	BytesProcessed int64 `json:"bytesProcessed,omitempty"`

	// BytesBilled is the total bytes billed for the query.
	BytesBilled int64 `json:"bytesBilled,omitempty"`

	// CreationTime is when the job was created.
	CreationTime time.Time `json:"creationTime,omitempty"`

	// StartTime is when the job execution started.
	StartTime time.Time `json:"startTime,omitempty"`

	// EndTime is when the job execution ended.
	EndTime time.Time `json:"endTime,omitempty"`

	// TotalSlotMs is the total slot milliseconds consumed.
	TotalSlotMs int64 `json:"totalSlotMs,omitempty"`
}

JobStats contains BigQuery job execution statistics.

type Request

type Request struct {
	// Query is the raw SQL query to execute against the BigQuery table.
	Query string `json:"query,omitempty" template:"true"`
}

Request represents parameters for BigQuery log queries.

+kubebuilder:object:generate=true

func (*Request) DeepCopy

func (in *Request) DeepCopy() *Request

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Request.

func (*Request) DeepCopyInto

func (in *Request) DeepCopyInto(out *Request)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Response

type Response struct {
	// Rows contains the actual log data.
	Rows []Row `json:"rows,omitempty"`

	// Schema contains the column names in the same order as the row values.
	Schema bigquery.Schema `json:"schema,omitempty"`

	// NextPageToken for pagination.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// TotalRows is the total number of rows in the result (if available).
	TotalRows int64 `json:"totalRows,omitempty"`

	// JobStats contains query execution statistics.
	JobStats *JobStats `json:"jobStats,omitempty"`
}

Response represents the response from BigQuery for log data.

func (*Response) ToLogResult

func (r *Response) ToLogResult(mappingConfig logs.FieldMappingConfig) (logs.LogResult, error)

ToLogResult converts the BigQuery response to the standard LogResult format.

type Row

type Row []bigquery.Value

type Searcher

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

Searcher implements log searching using BigQuery.

func New

func New(conn connection.GCPConnection, mappingConfig *logs.FieldMappingConfig) *Searcher

New creates a new BigQuery log searcher.

func (*Searcher) Close

func (s *Searcher) Close() error

Close closes the clients and releases resources.

func (*Searcher) Search

func (s *Searcher) Search(ctx context.Context, request Request) (*logs.LogResult, error)

Search executes a log search query using BigQuery.

Jump to

Keyboard shortcuts

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