api

package
v0.0.0-...-96a11e1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config) error

nolint:gocognit

Types

type Config

type Config struct {
	// InstanceID is the unique identifier for this instance of the API server
	InstanceID string

	// Platform identifies the cloud platform where the node is running (e.g., aws, gcp, hetzner)
	Platform string

	// Image specifies the container image identifier including repository and tag
	Image string

	// HttpPort defines the HTTP port for the API server to listen on (default: 7070)
	// Used in production deployments. Ignored if Listener is provided.
	HttpPort int

	// Listener defines a pre-created network listener for the HTTP server
	// If provided, the server will use this listener instead of creating one from HttpPort
	// This is intended for testing scenarios where ephemeral ports are needed to avoid conflicts
	Listener net.Listener

	// Region identifies the geographic region where this node is deployed
	Region string

	// RedisUrl is the Redis database connection string
	RedisUrl string

	// Enable TestMode
	TestMode bool

	// ClickhouseURL is the ClickHouse database connection string
	ClickhouseURL string

	// DatabasePrimary is the primary database connection string for read and write operations
	DatabasePrimary string

	// DatabaseReadonlyReplica is an optional read-replica database connection string for read operations
	DatabaseReadonlyReplica string

	// Enable sending otel data to the  collector endpoint for metrics, traces, and logs
	OtelEnabled           bool
	OtelTraceSamplingRate float64

	PrometheusPort int
	Clock          clock.Clock

	// TLSConfig provides HTTPS support when set
	TLSConfig *tls.Config

	// Vault Configuration
	VaultMasterKeys []string
	VaultS3         *S3Config

	// ChproxyToken is the authentication token for ClickHouse proxy endpoints
	ChproxyToken string
}

func (Config) Validate

func (c Config) Validate() error

type S3Config

type S3Config struct {
	URL             string
	Bucket          string
	AccessKeyID     string
	AccessKeySecret string
}

Jump to

Keyboard shortcuts

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