sitecontract

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package sitecontract is where a site release's contract meets the application it is a front end of (#2679): a release's _application file declares the application's contract versions it works with, a promotion into an environment that is a part of that application is refused when the release excludes the application's contract, and an application release reads what each of its site parts serves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, parts Parts, siteName, environment string, rel *site.Release) error

Check refuses a promotion of rel into the environment when the environment is a part of an application whose contract the release does not work with.

Types

type Parts

type Parts func(ctx context.Context, siteName, environment string) (application string, version int, ok bool)

Parts names the application a site environment is a part of and the contract version it declares; ok is false for an environment that is a part of none.

type Reader

type Reader struct {
	Store site.Store
	// Find reads a site by name or id.
	Find func(ctx context.Context, ref string) (*site.Site, error)
}

Reader reads what a site part serves and the contract a release declares, for an application release's check.

func (Reader) ReleaseContract

func (r Reader) ReleaseContract(ctx context.Context, ref string, number int) (*site.Contract, error)

ReleaseContract is the contract a release declares, nil for none.

func (Reader) ServedContract

func (r Reader) ServedContract(ctx context.Context, ref, environment string) (int, *site.Contract, error)

ServedContract is the release an environment serves and the contract it declares, nil for none; 0 when it serves none.

Jump to

Keyboard shortcuts

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