Skip to main content

Build cloud-native Go applications with Salt

A modular collection of battle-tested libraries for configuration, CLI tools, authentication, observability, and more in the Raystack ecosystem.

Get started in minutes

Salt provides everything you need to build robust Go applications with minimal setup

1

Install Salt

Add Salt to your Go project using go get:
go get github.com/raystack/salt
2

Import packages

Import the packages you need in your application:
import (
    "github.com/raystack/salt/config"
    "github.com/raystack/salt/log"
    "github.com/raystack/salt/db"
)
3

Initialize components

Set up the components for your application:
// Load configuration
loader := config.NewLoader(
    config.WithFile("./config.yaml"),
    config.WithEnvPrefix("MYAPP"),
)

var cfg AppConfig
if err := loader.Load(&cfg); err != nil {
    panic(err)
}

// Initialize logger
logger := log.NewLogrus(
    log.LogrusWithLevel("info"),
)

logger.Info("Application started")
4

Start building

You’re ready to build your cloud-native application with Salt’s utilities for CLI tools, authentication, database connections, telemetry, and more.
Check out the Packages Overview to explore all available utilities.

Explore by category

Choose the right package for your needs

Configuration

Manage application settings with environment variables, files, and defaults using Viper

CLI Utilities

Build powerful command-line tools with Cobra integration, prompts, and output formatting

Authentication

Implement OpenID Connect flows and audit logging for security and compliance

Database

Connect to databases with connection pooling, transactions, and migration support

Observability

Integrate OpenTelemetry for metrics and distributed tracing

Logging

Structured logging with support for Logrus and Zap

JSON Utilities

Calculate differences between JSON documents and reconstruct from diffs

Query Language

Parse REST query parameters for filtering, sorting, and pagination

Key features

Production-ready

Battle-tested libraries used across the Raystack ecosystem in production environments

Modular design

Pick only the packages you need without bringing in unnecessary dependencies

Type-safe

Full Go type safety with comprehensive struct tags and validation support

Cloud-native

Built for modern cloud infrastructure with observability, health checks, and graceful shutdowns

Ready to get started?

Explore the comprehensive API reference or jump straight into building with our quickstart guide