appexport

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package appexport renders an app as plain Docker Compose plus an env template so leaving Levelrail never needs Levelrail. Secret values are never part of the input type; the caller classifies env before export.

Index

Constants

View Source
const SecretPlaceholder = "CHANGE_ME"

SecretPlaceholder stands in for every value that must not leave the server.

Variables

View Source
var ErrInvalidName = errors.New("appexport: invalid service or variable name")

ErrInvalidName marks a service key or env name that cannot be written to compose or .env without breaking the file structure.

Functions

func WriteTar

func WriteTar(w io.Writer, files []File) error

WriteTar writes files as a deterministic tar stream (fixed mtime and owner).

Types

type BindMount

type BindMount struct {
	HostPath      string
	ContainerPath string
	ReadOnly      bool
}

BindMount is a host path mount; it is exported as is and flagged in the README.

type File

type File struct {
	Name    string
	Content []byte
}

File is one produced file.

func Render

func Render(in Input) ([]File, error)

Render produces docker-compose.yml, .env.example and README.md, sorted and byte-stable for the same input.

type Input

type Input struct {
	AppName  string
	Services []Service
}

Input is everything one export needs.

type Port

type Port struct {
	HostPort      int
	ContainerPort int
	Protocol      string
}

Port is an extra host-published port.

type Probe

type Probe struct {
	Path     string
	Scheme   string
	TCP      bool
	Exec     []string
	Interval string
	Timeout  string
	Failures int
}

Probe is the readiness probe of a service.

type Service

type Service struct {
	Key              string
	Image            string
	Command          []string
	Entrypoint       []string
	Port             int
	Domains          []string
	Env              map[string]string
	SecretEnv        []string
	Refs             map[string]string
	Volumes          []Volume
	BindMounts       []BindMount
	Ports            []Port
	Health           *Probe
	DependsOn        []string
	DependsOnHealthy []string
	Restart          string
	MemoryBytes      int64
	NanoCPUs         int64
	PullPolicy       string
	FilePaths        []string
}

Service is one container of the app. Env holds only non-secret values as stored; SecretEnv and Refs hold names and descriptions, never values.

type Volume

type Volume struct {
	Name          string
	ContainerPath string
}

Volume is a named volume mounted into a service.

Jump to

Keyboard shortcuts

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