sort

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderVariables

func OrderVariables(req *OrderRequest) ([]*pb.ConfigVar, error)

OrderVariables considers the data in the OrderRequest and calculates the correct order to evalutate each ConfigVar, and then returns the vars in that order. It also filters variables based on the values in the OrderRequest, depending on what is set.

Types

type ArtifactStartDesc

type ArtifactStartDesc []*pb.PushedArtifact

ArtifactStartDesc sorts builds by start time descending (most recent first). For the opposite, use sort.Reverse.

func (ArtifactStartDesc) Len

func (s ArtifactStartDesc) Len() int

func (ArtifactStartDesc) Less

func (s ArtifactStartDesc) Less(i, j int) bool

func (ArtifactStartDesc) Swap

func (s ArtifactStartDesc) Swap(i, j int)

type BuildStartDesc

type BuildStartDesc []*pb.Build

BuildStartDesc sorts builds by start time descending (most recent first). For the opposite, use sort.Reverse.

func (BuildStartDesc) Len

func (s BuildStartDesc) Len() int

func (BuildStartDesc) Less

func (s BuildStartDesc) Less(i, j int) bool

func (BuildStartDesc) Swap

func (s BuildStartDesc) Swap(i, j int)

type ConfigName

type ConfigName []*pb.ConfigVar

ConfigName sorts config variables by name.

func (ConfigName) Len

func (s ConfigName) Len() int

func (ConfigName) Less

func (s ConfigName) Less(i, j int) bool

func (ConfigName) Swap

func (s ConfigName) Swap(i, j int)

type ConfigResolution

type ConfigResolution []*pb.ConfigVar

ConfigResolution sorts a set of config variables such that if they were evaluated in-order to see if they match an environment, you can always take the most recent match as the current value. i.e. conflict resolution is handled for you in the iteration order.

func (ConfigResolution) Len

func (s ConfigResolution) Len() int

func (ConfigResolution) Less

func (s ConfigResolution) Less(i, j int) bool

func (ConfigResolution) Swap

func (s ConfigResolution) Swap(i, j int)

type ConfigSource added in v0.10.4

type ConfigSource []*pb.ConfigSource

func (ConfigSource) Len added in v0.10.4

func (s ConfigSource) Len() int

func (ConfigSource) Less added in v0.10.4

func (s ConfigSource) Less(i, j int) bool

func (ConfigSource) Swap added in v0.10.4

func (s ConfigSource) Swap(i, j int)

type DeploymentBundleCompleteDesc

type DeploymentBundleCompleteDesc []*pb.UI_DeploymentBundle

DeploymentBundleCompleteDesc sorts deployment bundles by completion time descending.

func (DeploymentBundleCompleteDesc) Len

func (DeploymentBundleCompleteDesc) Less

func (s DeploymentBundleCompleteDesc) Less(i, j int) bool

func (DeploymentBundleCompleteDesc) Swap

func (s DeploymentBundleCompleteDesc) Swap(i, j int)

type DeploymentBundleStartDesc

type DeploymentBundleStartDesc []*pb.UI_DeploymentBundle

DeploymentBundleStartDesc sorts deployment bundles by start time descending.

func (DeploymentBundleStartDesc) Len

func (DeploymentBundleStartDesc) Less

func (s DeploymentBundleStartDesc) Less(i, j int) bool

func (DeploymentBundleStartDesc) Swap

func (s DeploymentBundleStartDesc) Swap(i, j int)

type DeploymentCompleteDesc

type DeploymentCompleteDesc []*pb.Deployment

DeploymentCompleteDesc sorts deployments by completion time descending.

func (DeploymentCompleteDesc) Len

func (s DeploymentCompleteDesc) Len() int

func (DeploymentCompleteDesc) Less

func (s DeploymentCompleteDesc) Less(i, j int) bool

func (DeploymentCompleteDesc) Swap

func (s DeploymentCompleteDesc) Swap(i, j int)

type DeploymentStartDesc

type DeploymentStartDesc []*pb.Deployment

DeploymentStartDesc sorts deployments by start time descending.

func (DeploymentStartDesc) Len

func (s DeploymentStartDesc) Len() int

func (DeploymentStartDesc) Less

func (s DeploymentStartDesc) Less(i, j int) bool

func (DeploymentStartDesc) Swap

func (s DeploymentStartDesc) Swap(i, j int)

type OrderRequest

type OrderRequest struct {
	Set       [][]*pb.ConfigVar
	Merge     bool
	Runner    *pb.Ref_RunnerId
	Workspace *pb.Ref_Workspace
	Labels    map[string]string
}

OrderRequest is the input to OrderVariables, with all the information to properly calculate the order to evalutate each variable.

type ReleaseBundleCompleteDesc

type ReleaseBundleCompleteDesc []*pb.UI_ReleaseBundle

ReleaseBundleCompleteDesc sorts deployment bundles by completion time descending.

func (ReleaseBundleCompleteDesc) Len

func (ReleaseBundleCompleteDesc) Less

func (s ReleaseBundleCompleteDesc) Less(i, j int) bool

func (ReleaseBundleCompleteDesc) Swap

func (s ReleaseBundleCompleteDesc) Swap(i, j int)

Jump to

Keyboard shortcuts

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