element-ess-helm/matrix-tools
2025-12-23 15:03:41 +01:00
..
cmd git ls-files | xargs sed -i '/^\/\/ Copyright .* New Vector Ltd/a \/\/ Copyright 2025 Element Creations Ltd' 2025-10-27 09:36:54 +00:00
internal Only RSA and ECDSA Prime256v1 generation is actually supported 2025-12-08 14:26:25 +00:00
Dockerfile upgrade matrix-tools to go 1.25 2025-12-23 15:03:41 +01:00
go.mod Bump the minor-and-patches group in /matrix-tools with 3 updates 2025-12-22 22:12:49 +00:00
go.sum Bump the minor-and-patches group in /matrix-tools with 3 updates 2025-12-22 22:12:49 +00:00
go.sum.license git ls-files | xargs sed -i '/^Copyright .* New Vector Ltd/a Copyright 2025 Element Creations Ltd' 2025-10-27 08:43:19 +00:00
README.md git ls-files | xargs sed -i '/^Copyright .* New Vector Ltd/a Copyright 2025 Element Creations Ltd' 2025-10-27 08:43:19 +00:00

Developer Guide for matrix-tools Go Project

Overview

The matrix-tools Go project is designed to handle dynamic configuration builds and other chart features. This guide provides detailed information on setting up the development environment, running tests, and understanding the project structure.

Prerequisites

Before starting development, ensure you have the following tools installed:

Installation

Setting up the Go Environment

  1. Install Go 1.23.4.
  2. Initialize your Go environment by setting up your GOPATH and GOROOT.

Installing Dependencies

Use go mod to manage dependencies:

# Navigate to the project root directory
cd path/to/matrix-tools

# Download all dependencies
go mod download

Development Environment

Building the Project

Building the Go Application

To build the Go application, run:

cd matrix-tools
go build -o matrix-tools cmd/main.go

Linting

The project linting uses golangci-lint

golangci-lint run ./...

Project structure

matrix-tools is built around subcomands calling different internal packages :

  • render-config relies on package internal/pkg/renderer
  • tcpwait relies on package internal/pkg/tcpwait

Render Config

render-config is a command line tool that renders a YAML config file from a list of YAML input files. These files are deep merged. Similarly to envsubstr, it supports the use of environment variables in config files and will interpolate them during rendering. Their interpolation supports go templating. 3 template functions are available :

  • hostname returns the hostname of the machine.
  • readfile reads a file and returns its content as string.
  • replace replaces occurrences of a substring with another substring in the input string.
  • quote quotes the input string with double quotes.

TCP Wait

tcpwait is a command line tool that waits until a given port becomes available on a given address.

Running Tests

The project includes unit tests for various components. To run all tests:

# Run tests using go test
go test ./...