deploy

package
v0.8.0-a.3 Latest Latest
Warning

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

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

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