bigqueries

package
v0.0.26-beta Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BQServiceWrapper

type BQServiceWrapper[T any] struct {
	*microservice.BaseServer
	// contains filtered or unexported fields
}

BQServiceWrapper wraps the ProcessingService for a common interface.

func NewBQServiceWrapper

func NewBQServiceWrapper[T any](
	ctx context.Context,
	cfg *Config,
	logger zerolog.Logger,
	transformer messagepipeline.MessageTransformer[T],
) (wrapper *BQServiceWrapper[T], err error)

NewBQServiceWrapper creates and configures a new generic BQServiceWrapper instance.

func (*BQServiceWrapper[T]) GetHTTPPort

func (s *BQServiceWrapper[T]) GetHTTPPort() string

GetHTTPPort returns the HTTP port the service is listening on.

func (*BQServiceWrapper[T]) Mux

func (s *BQServiceWrapper[T]) Mux() *http.ServeMux

Mux returns the HTTP ServeMux.

func (*BQServiceWrapper[T]) Shutdown

func (s *BQServiceWrapper[T]) Shutdown(ctx context.Context) error

Shutdown gracefully stops the BQ processing service and its components.

func (*BQServiceWrapper[T]) Start

func (s *BQServiceWrapper[T]) Start(ctx context.Context) error

Start initiates the BQ processing service and the embedded HTTP server.

type Config

type Config struct {
	microservice.BaseConfig
	ServiceName        string
	DataflowName       string
	ServiceDirectorURL string
	Consumer           Consumer
	BigQueryConfig     bqstore.BigQueryDatasetConfig
	ClientConnections  map[string][]option.ClientOption

	BatchProcessing struct {
		// Embed the refactored config, which includes BatchSize, FlushInterval, and InsertTimeout
		bqstore.BatchInserterConfig
		NumWorkers int
	}
}

Config holds all configuration for the BigQuery batch inserter application.

func LoadConfigDefaults

func LoadConfigDefaults(projectID string) (*Config, error)

LoadConfigDefaults initializes and loads configuration from defaults, flags, and environment variables.

type Consumer

type Consumer struct {
	SubscriptionID  string
	CredentialsFile string
}

Consumer defines the configuration for the Pub/Sub subscriber.

Jump to

Keyboard shortcuts

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