projectmeta

package
v0.1.0-rc.39 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package projectmeta validates and writes browser-safe project metadata.

Index

Constants

View Source
const (
	DirectoryName    = ".tnl"
	JSONName         = "project.json"
	DeclarationsName = "project.d.ts"
	MaxFileBytes     = 64 << 10
)
View Source
const Version = 1

Variables

This section is empty.

Functions

func Render

func Render(metadata Metadata) ([]byte, []byte, error)

func Write

func Write(ctx context.Context, projectRoot string, metadata Metadata) error

Write validates project metadata and replaces both generated files while holding the writer lock. each file replacement is atomic, but both files do not become visible at the same instant. if the second replacement fails, Write tries to restore the first file.

Types

type Metadata

type Metadata struct {
	Namespace          string             `json:"namespace"`
	Dev                bool               `json:"dev"`
	ServiceDirectories map[string]string  `json:"serviceDirectories"`
	Services           map[string]Service `json:"services"`
	Version            int                `json:"version"`
}

Metadata is the generated .tnl/project.json contract. ServiceDirectories is private discovery data and is deliberately omitted from public declarations.

func (Metadata) Public

func (m Metadata) Public(dev bool) PublicMetadata

func (Metadata) Validate

func (m Metadata) Validate() error

type PublicMetadata

type PublicMetadata struct {
	Namespace string             `json:"namespace"`
	Services  map[string]Service `json:"services"`
	Dev       bool               `json:"dev"`
}

PublicMetadata is the value exposed by @tnldotdev/tnl.

type Service

type Service struct {
	Namespace string `json:"namespace"`
	Hostname  string `json:"hostname"`
	URL       string `json:"url"`
}

Jump to

Keyboard shortcuts

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