Documentation
¶
Index ¶
- func GetCloudSQLOpts(ipType, userAgent string, useIAM bool) ([]cloudsqlconn.Option, error)
- func GetIAMAccessToken(ctx context.Context) (string, error)
- func GetIAMPrincipalEmailFromADC(ctx context.Context) (string, error)
- func InitConnectionSpan(ctx context.Context, tracer trace.Tracer, sourceKind, sourceName string) (context.Context, trace.Span)
- func Register(kind string, factory SourceConfigFactory) bool
- type Dialect
- type IPType
- type Source
- type SourceConfig
- type SourceConfigFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCloudSQLOpts ¶ added in v0.1.0
func GetCloudSQLOpts(ipType, userAgent string, useIAM bool) ([]cloudsqlconn.Option, error)
GetCloudSQLDialOpts retrieve dial options with the right ip type and user agent for cloud sql databases.
func GetIAMAccessToken ¶ added in v0.8.0
func GetIAMPrincipalEmailFromADC ¶ added in v0.4.0
GetIAMPrincipalEmailFromADC finds the email associated with ADC
func InitConnectionSpan ¶ added in v0.0.5
func InitConnectionSpan(ctx context.Context, tracer trace.Tracer, sourceKind, sourceName string) (context.Context, trace.Span)
InitConnectionSpan adds a span for database pool connection initialization
func Register ¶ added in v0.7.0
func Register(kind string, factory SourceConfigFactory) bool
Register registers a new source kind with its factory. It returns false if the kind is already registered.
Types ¶
type Dialect ¶ added in v0.0.3
type Dialect string
Dialect represents the dialect type of a database.
type Source ¶
type Source interface {
SourceKind() string
}
Source is the interface for the source itself.
type SourceConfig ¶ added in v0.0.2
type SourceConfig interface { SourceConfigKind() string Initialize(ctx context.Context, tracer trace.Tracer) (Source, error) }
SourceConfig is the interface for configuring a source.
func DecodeConfig ¶ added in v0.7.0
func DecodeConfig(ctx context.Context, kind string, name string, decoder *yaml.Decoder) (SourceConfig, error)
DecodeConfig decodes a source configuration using the registered factory for the given kind.
type SourceConfigFactory ¶ added in v0.7.0
type SourceConfigFactory func(ctx context.Context, name string, decoder *yaml.Decoder) (SourceConfig, error)
SourceConfigFactory defines the function signature for creating a SourceConfig.