toolkitcfg

package
v1.100.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package toolkitcfg resolves typed per-toolkit connection configuration out of the platform's raw toolkits config (map[string]any decoded from YAML/JSON).

The platform stores toolkit config as toolkits.<kind>.instances.<name>.<key>; these helpers walk that structure, pick the default instance when none is named, and extract the typed DataHub / Trino / S3 settings the providers need. Split out of pkg/platform to keep that package under its size budget (#756); the primitive typed-map accessors live in the sibling cfgmap package.

Index

Constants

View Source
const (
	DefaultTrinoPort       = 8080
	DefaultTrinoQueryLimit = 1000
	DefaultTrinoMaxLimit   = 10000
)

Trino connection defaults, applied when an instance omits the setting.

Variables

This section is empty.

Functions

func InstanceConfig

func InstanceConfig(toolkits map[string]any, kind, instance string) map[string]any

InstanceConfig retrieves one instance's config map for a toolkit kind. When instance is "" it resolves the default (or first) instance. Returns nil if the kind, its instances map, or the named instance is absent or malformed.

func ResolveDefaultInstance

func ResolveDefaultInstance(kindCfg, instances map[string]any) string

ResolveDefaultInstance determines which instance to use: the one named by the kind's "default" key, else the first instance, else "".

Types

type DataHub

type DataHub struct {
	URL     string
	Token   string
	Timeout time.Duration
	Debug   bool
}

DataHub holds extracted DataHub configuration.

func DataHubConfig

func DataHubConfig(toolkits map[string]any, instance string) *DataHub

DataHubConfig extracts DataHub configuration for the named instance (or the default instance when instance is ""). Returns nil if not configured.

type S3

type S3 struct {
	Region         string
	Endpoint       string
	AccessKeyID    string
	SecretKey      string
	BucketPrefix   string
	ConnectionName string
	UsePathStyle   bool
}

S3 holds extracted S3 configuration.

func S3Config

func S3Config(toolkits map[string]any, instance string) *S3

S3Config extracts S3 configuration for the named instance (or the default instance when instance is ""). Returns nil if not configured. When the instance omits connection_name it defaults to the instance name.

type Trino

type Trino struct {
	Host           string
	Port           int
	User           string
	Password       string // #nosec G117 -- Trino connection credential from admin config
	Catalog        string
	Schema         string
	SSL            bool
	SSLVerify      bool
	Timeout        time.Duration
	DefaultLimit   int
	MaxLimit       int
	ReadOnly       bool
	ConnectionName string
}

Trino holds extracted Trino configuration.

func TrinoConfig

func TrinoConfig(toolkits map[string]any, instance string) *Trino

TrinoConfig extracts Trino configuration for the named instance (or the default instance when instance is ""). Returns nil if not configured.

Jump to

Keyboard shortcuts

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