spec

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package spec reads and validates platformgo.yaml, the description of a project.

Index

Constants

View Source
const FileName = "platformgo.yaml"

FileName is the description file in the project root.

View Source
const SchemaVersion = 1

SchemaVersion is the file format this platformgo understands.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Schema   int                       `yaml:"schema"`
	Platform string                    `yaml:"platform"`
	Project  Project                   `yaml:"project"`
	Modules  map[string]map[string]any `yaml:"modules"`
}

File is the content of platformgo.yaml.

func Load

func Load(path string) (*File, error)

Load reads the description file and validates it.

func Parse

func Parse(raw []byte) (*File, error)

Parse reads the description from bytes.

func (*File) EnabledModules

func (f *File) EnabledModules() []registry.Module

EnabledModules returns modules in dependency order: dependencies come first. The order is stable, so generated files do not change between runs.

func (*File) Service

func (f *File) Service() string

Service returns the service name: from the file, or the last element of the module path.

type Project

type Project struct {
	Module  string `yaml:"module"`  // Go module path
	Service string `yaml:"service"` // service name in logs
	Go      string `yaml:"go"`      // Go version
}

Project describes the project itself.

Jump to

Keyboard shortcuts

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