catalog

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog knows the types of services a project is made of (docs/product/ glossary.md): runtimes the applications run on, stores and tools that run as their own containers, and processes that run an application's code in the background.

Index

Constants

View Source
const (
	Queue   = "queue"
	Cronjob = "cronjob"
)

Queue and Cronjob are the process types.

View Source
const Custom = "custom"

Custom is a container service from an image the catalog does not know.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names lists the types, for help and errors.

Types

type Kind

type Kind string

Kind tells how a service runs.

const (
	// Runtime: no container of its own; the applications it is attached to run on its
	// image (php 8.3 → php:8.3) with their code mounted.
	Runtime Kind = "runtime"
	// Container: its own container from its image (mysql, redis, typesense…).
	Container Kind = "container"
	// Process: runs the code of the application it is attached to with its own command
	// (a queue worker, a cron job).
	Process Kind = "process"
)

type Type

type Type struct {
	Name string
	Kind Kind
	// Repo is the image repository; the version is the tag.
	Repo string
	// Port is where other containers connect; UIPort serves a web UI.
	Port, UIPort int
	// Aliases are other names people use for the type.
	Aliases []string
}

Type is a kind of service the catalog knows.

func FromImage

func FromImage(image string) (Type, string)

FromImage recognises the type of a service by its image: postgres:17.6 → postgres 17.6, axllent/mailpit:v1.27 → mailpit v1.27. Images the catalog does not know are Custom; a digest is not a version.

func FromRuntime

func FromRuntime(runtime string) (Type, string, bool)

FromRuntime reads a runtime of workspace.yaml v1: php:8.3 → php 8.3, node:22 → nodejs 22.

func Lookup

func Lookup(name string) (Type, bool)

Lookup finds a type by its name or an alias.

func Types

func Types() []Type

Types lists the types, in the catalog's order: runtimes, containers, processes.

func (Type) Image

func (t Type) Image(version string) string

Image is the image of a version of the type: php 8.3 → php:8.3.

Jump to

Keyboard shortcuts

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