Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTemplate

func RenderTemplate(path string, overrides map[string]string) ([]byte, error)

RenderTemplate renders a config through Jinja2, the templating the config spec is written in: every SQLFLOW_-prefixed environment variable is in scope, plus the settings vars, plus explicit overrides.

func SQLResultsCacheDir

func SQLResultsCacheDir() string

SQLResultsCacheDir mirrors sqlflow.settings.SQL_RESULTS_CACHE_DIR: where disk-backed handlers stage their batch and result files. It is the fallback for a handler that does not declare sql_results_cache_dir.

Types

type ClickhouseSink

type ClickhouseSink struct {
	DSN   string `yaml:"dsn"`
	Table string `yaml:"table"`
}

type Conf

type Conf struct {
	Pipeline Pipeline     `yaml:"pipeline"`
	Tables   *Tables      `yaml:"tables,omitempty"`
	UDFs     []UDF        `yaml:"udfs,omitempty"`
	Commands []SQLCommand `yaml:"commands,omitempty"`
}

Conf

func Load

func Load(path string, overrides map[string]string) (*Conf, error)

type ConsoleSink

type ConsoleSink struct{}

type Error

type Error struct {
	Policy ErrorPolicy `yaml:"policy"`
}

Error

type ErrorPolicy

type ErrorPolicy string
const (
	PolicyRaise  ErrorPolicy = "RAISE"
	PolicyIgnore ErrorPolicy = "IGNORE"
)

type Handler

type Handler struct {
	Type               string `yaml:"type"`
	SQL                string `yaml:"sql"`
	SQLResultsCacheDir string `yaml:"sql_results_cache_dir,omitempty"`
	Table              string `yaml:"table,omitempty"`
}

Handler

type IcebergSink

type IcebergSink struct {
	CatalogName string `yaml:"catalog_name"`
	TableName   string `yaml:"table_name"`
}

Various Sink Configs

type KafkaSASL

type KafkaSASL struct {
	Mechanism string `yaml:"mechanism"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
}

KafkaSASL configures SASL authentication for a Kafka connection.

type KafkaSSL

type KafkaSSL struct {
	CALocation                      string `yaml:"ca_location,omitempty"`
	CertificateLocation             string `yaml:"certificate_location,omitempty"`
	KeyLocation                     string `yaml:"key_location,omitempty"`
	KeyPassword                     string `yaml:"key_password,omitempty"`
	EndpointIdentificationAlgorithm string `yaml:"endpoint_identification_algorithm,omitempty"`
}

KafkaSSL configures TLS material for a Kafka connection.

type KafkaSink

type KafkaSink struct {
	Brokers          []string   `yaml:"brokers"`
	Topic            string     `yaml:"topic"`
	SecurityProtocol string     `yaml:"security_protocol,omitempty"`
	SSL              *KafkaSSL  `yaml:"ssl,omitempty"`
	SASL             *KafkaSASL `yaml:"sasl,omitempty"`
}

type KafkaSource

type KafkaSource struct {
	Brokers         []string `yaml:"brokers"`
	GroupID         string   `yaml:"group_id"`
	AutoOffsetReset string   `yaml:"auto_offset_reset"`
	Topics          []string `yaml:"topics"`

	SecurityProtocol string     `yaml:"security_protocol,omitempty"`
	SSL              *KafkaSSL  `yaml:"ssl,omitempty"`
	SASL             *KafkaSASL `yaml:"sasl,omitempty"`
}

Source Types

type OnError

type OnError struct {
	Policy string `yaml:"policy"`
	DLQ    *Sink  `yaml:"dlq,omitempty"`
}

OnError configures what happens to a message or batch that fails. The dlq block is a full sink definition, used when policy is DLQ.

type Pipeline

type Pipeline struct {
	Name                 string   `yaml:"name,omitempty"`
	Description          string   `yaml:"description,omitempty"`
	Source               Source   `yaml:"source"`
	Handler              Handler  `yaml:"handler"`
	Sink                 Sink     `yaml:"sink"`
	BatchSize            int      `yaml:"batch_size,omitempty"`
	FlushIntervalSeconds int      `yaml:"flush_interval_seconds,omitempty"`
	OnError              *OnError `yaml:"on_error,omitempty"`
}

Pipeline

type SQLCommand

type SQLCommand struct {
	Name string `yaml:"name"`
	SQL  string `yaml:"sql"`
}

SQL Command

type SQLCommandSink

type SQLCommandSink struct {
	SQL           string                   `yaml:"sql"`
	Substitutions []SQLCommandSubstitution `yaml:"substitutions,omitempty"`
}

type SQLCommandSubstitution

type SQLCommandSubstitution struct {
	Var  string `yaml:"var"`
	Type string `yaml:"type"`
}

type Sink

type Sink struct {
	Type       string          `yaml:"type"`
	Format     *SinkFormat     `yaml:"format,omitempty"`
	Kafka      *KafkaSink      `yaml:"kafka,omitempty"`
	Console    *ConsoleSink    `yaml:"console,omitempty"`
	SQLCommand *SQLCommandSink `yaml:"sqlcommand,omitempty"`
	Iceberg    *IcebergSink    `yaml:"iceberg,omitempty"`
	Clickhouse *ClickhouseSink `yaml:"clickhouse,omitempty"`
}

Unified Sink

type SinkFormat

type SinkFormat struct {
	Type string `yaml:"type"`
}

SinkFormat

type Source

type Source struct {
	Type      string           `yaml:"type"`
	Kafka     *KafkaSource     `yaml:"kafka,omitempty"`
	Websocket *WebsocketSource `yaml:"websocket,omitempty"`
	Webhook   *WebhookSource   `yaml:"webhook,omitempty"`
	Error     *Error           `yaml:"error,omitempty"`
}

Source

type TableManager

type TableManager struct {
	TumblingWindow *TumblingWindow `yaml:"tumbling_window"`
	Sink           Sink            `yaml:"sink"`
}

Table Manager

type TableSQL

type TableSQL struct {
	Name    string        `yaml:"name"`
	SQL     string        `yaml:"sql"`
	Manager *TableManager `yaml:"manager,omitempty"`
}

SQL Tables

type Tables

type Tables struct {
	SQL []TableSQL `yaml:"sql"`
}

Tables

type TumblingWindow

type TumblingWindow struct {
	CollectSQL       string `yaml:"collect_closed_windows_sql"`
	DeleteSQL        string `yaml:"delete_closed_windows_sql"`
	PollIntervalSecs int    `yaml:"poll_interval_seconds"`
}

Tumbling Window Manager

type UDF

type UDF struct {
	FunctionName string `yaml:"function_name"`
	ImportPath   string `yaml:"import_path"`
}

UDFs

type WebhookHMAC

type WebhookHMAC struct {
	Header string `yaml:"header"`
	SigKey string `yaml:"sig_key"`
	Secret string `yaml:"secret"`
}

WebhookHMAC configures signature validation of incoming webhook bodies. SigKey names the digest the signature header is prefixed with, e.g. "sha256" for GitHub's "X-Hub-Signature-256: sha256=<hex>".

type WebhookSource

type WebhookSource struct {
	SignatureType string       `yaml:"signature_type,omitempty"`
	HMAC          *WebhookHMAC `yaml:"hmac,omitempty"`
}

type WebsocketSource

type WebsocketSource struct {
	URI string `yaml:"uri"`
}

Jump to

Keyboard shortcuts

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