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 ¶
- func Library() *runtime.Library
- type Port
- type Service
- func (s Service) Constraints() []constraint.Constraint
- func (s *Service) Create(_ context.Context, _ any) (*ServiceOutput, error)
- func (s *Service) Delete(_ context.Context, _ any, _ *ServiceOutput) error
- func (s *Service) Read(_ context.Context, _ any, _ *ServiceOutput) (*ServiceOutput, error)
- func (s *Service) ReplaceFields() []string
- func (s *Service) SchemaVersion() int
- func (s *Service) Update(_ context.Context, _ any, _ runtime.Prior[Service, *ServiceOutput]) (*ServiceOutput, error)
- type ServiceOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) Read ¶
func (s *Service) Read(_ context.Context, _ any, _ *ServiceOutput) (*ServiceOutput, error)
func (*Service) ReplaceFields ¶
func (*Service) SchemaVersion ¶
type ServiceOutput ¶
ServiceOutput holds what rendering the spec computes; path is an input and is readable as one, so it is not copied here.