config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 4 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

Overview

Package config holds the server settings, their defaults, and their validation.

Index

Constants

View Source
const (
	DefaultMaxPageSize = 100
	DefaultAlgorithm   = "HS256"
	DefaultIssuer      = "libsql-rest"
	DefaultAudience    = "libsql-rest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled       bool
	Algorithm     string
	Secret        string
	PublicKeyPath string
	Issuer        string
	Audience      string
	Optional      bool
}

func (AuthConfig) IsRSA

func (a AuthConfig) IsRSA() bool

type Config

type Config struct {
	Server      ServerConfig
	DB          DBConfig
	Auth        AuthConfig
	MaxPageSize int
	AllowTables []string
}

func Default

func Default() Config

func (Config) IsTableAllowed

func (c Config) IsTableAllowed(name string) bool

func (Config) Validate

func (c Config) Validate() error

Validate reports the first setting that would stop the server from starting. Default supplies every default, so an empty required value here is an error.

type DBConfig

type DBConfig struct {
	Driver Driver
	URI    string
	Token  string
}

type Driver

type Driver string
const (
	DriverLibSQL Driver = "libsql"
	DriverSQLite Driver = "sqlite"
)

type ServerConfig

type ServerConfig struct {
	Host string
	Port int
}

Jump to

Keyboard shortcuts

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