sitecontract

package
v1.170.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 3 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 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