deploy

package
v0.8.0-a.8 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deploy is a small demonstration library that exists so examples and tests can exercise Go-declared constraints. Its single resource (service) renders a service spec to a local file, and its input type declares cross-field rules from a Constraints method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Library

func Library() *runtime.Library

Library returns the registration record for the `deploy` library.

Types

type Port

type Port struct {
	Number int64
	TLS    *bool
	Cert   *string
}

Port is one listening port of the service.

type Service

type Service struct {
	Name     string
	Tier     string
	Image    *string
	Build    *string
	Replicas int64
	Ports    []Port
	Path     string
}

Service renders a service spec to a file at Path, creating parent directories as needed. Changing the path replaces the resource.

func (Service) Constraints

func (s Service) Constraints() []constraint.Constraint

Constraints declares the rules the service's inputs must satisfy. The fields are real struct fields, so the Go compiler checks that they exist; unobin reads the rules from source at compile time and checks every `deploy.service` body against them, exactly as it checks a UB constraints block.

func (*Service) Create

func (s *Service) Create(_ context.Context, _ any) (*ServiceOutput, error)

func (*Service) Delete

func (s *Service) Delete(_ context.Context, _ any, _ *ServiceOutput) error

func (*Service) Read

func (s *Service) Read(_ context.Context, _ any, _ *ServiceOutput) (*ServiceOutput, error)

func (*Service) ReplaceFields

func (s *Service) ReplaceFields() []string

func (*Service) SchemaVersion

func (s *Service) SchemaVersion() int

func (*Service) Update

type ServiceOutput

type ServiceOutput struct {
	SHA256 string
	Size   int64
}

ServiceOutput holds what rendering the spec computes; path is an input and is readable as one, so it is not copied here.

Jump to

Keyboard shortcuts

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