spanner

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const InstanceTypeOmni = "omni"

InstanceTypeOmni selects a Spanner Omni deployment instead of Cloud Spanner.

View Source
const SourceType string = "spanner"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name string `yaml:"name" validate:"required"`
	Type string `yaml:"type" validate:"required"`
	// Project and Instance are required for Cloud Spanner and optional for
	// Spanner Omni.
	Project        string          `yaml:"project"`
	Instance       string          `yaml:"instance"`
	Dialect        sources.Dialect `yaml:"dialect" validate:"required"`
	Database       string          `yaml:"database" validate:"required"`
	UseClientOAuth bool            `yaml:"useClientOAuth"`
	// InstanceType is "cloud" (default) or "omni". The omni-prefixed fields
	// apply only to Spanner Omni.
	InstanceType              string `yaml:"instanceType" validate:"omitempty,oneof=cloud omni"`
	OmniEndpoint              string `yaml:"omniEndpoint"`
	OmniUsePlainText          bool   `yaml:"omniUsePlainText"`
	OmniCaCertificateFile     string `yaml:"omniCaCertificateFile"`
	OmniClientCertificateFile string `yaml:"omniClientCertificateFile"`
	OmniClientKeyFile         string `yaml:"omniClientKeyFile"`
	OmniUsername              string `yaml:"omniUsername"`
	OmniPassword              string `yaml:"omniPassword"`
}

func (Config) Initialize

func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error)

func (Config) SourceConfigType

func (r Config) SourceConfigType() string

type Source

type Source struct {
	Config
	Client *spanner.Client
	// contains filtered or unexported fields
}

func (*Source) DatabaseDialect

func (s *Source) DatabaseDialect() string

func (*Source) GetCatalogClient added in v1.4.0

func (s *Source) GetCatalogClient(ctx context.Context, tokenString string) (*dataplexapi.CatalogClient, error)

func (*Source) InvokeSearchCatalog added in v1.4.0

func (s *Source) InvokeSearchCatalog(ctx context.Context, params map[string]any, tokenStr string) ([]searchcatalog.DataplexSearchResponse, error)

func (*Source) IsReadOnly added in v1.10.0

func (s *Source) IsReadOnly() bool

func (*Source) ProjectID added in v1.4.0

func (s *Source) ProjectID() string

func (*Source) RunSQL

func (s *Source) RunSQL(ctx context.Context, readOnly bool, statement string, params map[string]any) (any, error)

func (*Source) SourceType

func (s *Source) SourceType() string

func (*Source) SpannerClient

func (s *Source) SpannerClient() *spanner.Client

func (*Source) ToConfig

func (s *Source) ToConfig() sources.SourceConfig

func (*Source) UseClientAuthorization added in v1.4.0

func (s *Source) UseClientAuthorization() bool

Jump to

Keyboard shortcuts

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