templates

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package templates renders the workspace files from openarch.yaml.

Index

Constants

View Source
const (
	SelfSignedCert = "certs/cert.pem"
	SelfSignedKey  = "certs/key.pem"
)

Workspace paths of the files written for TLS self-signed.

View Source
const OpenSearchUsersFile = "config/opensearch/internal_users.yml"

OpenSearchUsersFile is the workspace path of the OpenSearch internal users file.

Variables

View Source
var DefaultImages = Images{
	MongoDB:    "mongo:7.0.39@sha256:9bdaeb6dac6e7e762e84e2f84103d1f9bb078fa1ba6bde8bb9d2274f655ad173",
	OpenSearch: "opensearchproject/opensearch:2.19.6@sha256:8690b204fe914c60ca76d451ac73bc0481e034d32d3779944c8caca56a2b003f",
	Dashboards: "opensearchproject/opensearch-dashboards:2.19.6@sha256:7aaefffac1660cab61ecf1e52fdcde6c156587a020dfa9246d529ea5e784dcee",
	Caddy:      "caddy:2.11.7@sha256:36c24ad91a7ff7bc4c87fe22bfa8df3c4b18da0773d73fc12ee2c52b98c0bb7e",
}

DefaultImages are the images tested with this CLI. MongoDB and OpenSearch match upstream OpenArch.

Functions

This section is empty.

Types

type File

type File struct {
	Path string
	Data []byte
	Mode fs.FileMode
}

File is a rendered file. Path is relative to the workspace and uses '/'.

func Render

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

Render returns the generated files of a workspace, in a stable order. It does not include openarch.yaml, .env.local or certificates.

type Images

type Images struct {
	MongoDB    string
	OpenSearch string
	Dashboards string
	Caddy      string
}

Images are the pinned images of the stack, except OpenArch, whose tag comes from openarch.yaml.

type Input

type Input struct {
	Config           workspace.Config
	Sizing           workspace.Sizing
	AdminUser        string
	AdminHash        string
	OpenSearchHashes OpenSearchHashes
	// Users is the current users file. Its other users and groups are kept.
	Users users.File
}

Input is everything the templates need. Hashes are bcrypt hashes; the templates never see a password.

type OpenSearchHashes

type OpenSearchHashes struct {
	Admin      string
	App        string
	Dashboards string
}

OpenSearchHashes are the hashes of the OpenSearch internal users.

Jump to

Keyboard shortcuts

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