buildnum

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package buildnum contains stuff to do with generating build numbers.

Package buildnum contains stuff to do with generating build numbers.

Package buildnum contains stuff to do with generating build numbers.

Index

Constants

View Source
const (
	// HealthPath is the URL path for the HTTP endpoint that returns health status.
	HealthPath = "/health"
	// ReadyPath URL path for the HTTP endpoint that returns ready status.
	ReadyPath = "/ready"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildNumberIssuer

type BuildNumberIssuer interface {

	// NextBuildNumber generates the next build number for the supplied pipeline.
	// Returns the build number, or the error that occurred.
	NextBuildNumber(pipeline kube.PipelineID) (string, error)

	// Ready returns true if the generator is ready to generate build numbers, otherwise false.
	Ready() bool
}

BuildNumberIssuer generates build numbers for activities.

type HTTPBuildNumberServer

type HTTPBuildNumberServer struct {
	// contains filtered or unexported fields
}

HTTPBuildNumberServer runs an HTTP server to serve build numbers, similar to Prow's tot (https://github.com/kubernetes/test-infra/tree/master/prow/cmd/tot)

func NewHTTPBuildNumberServer

func NewHTTPBuildNumberServer(bindAddress string, port int, issuer BuildNumberIssuer) *HTTPBuildNumberServer

NewHTTPBuildNumberServer creates a new, initialised HTTPBuildNumberServer. Use 'bindAddress' to control the address/interface the HTTP service will listen on; to listen on all interfaces (i.e. 0.0.0.0 or ::) provide a blank string. Build numbers will be generated using the specified BuildNumberIssuer.

func (*HTTPBuildNumberServer) Start

func (s *HTTPBuildNumberServer) Start() error

Start the HTTP server. This call will block until the server exits.

type PipelineActivityBuildNumGen

type PipelineActivityBuildNumGen struct {
	// contains filtered or unexported fields
}

PipelineActivityBuildNumGen generates build numbers backed by PipelineActivity K8S CRDs.

func NewCRDBuildNumGen

func NewCRDBuildNumGen(jxClient versioned.Interface, ns string) *PipelineActivityBuildNumGen

NewCRDBuildNumGen initialises a new PipelineActivityBuildNumGen that will use the supplied PipelineActivityInterface to query CRDs.

func (*PipelineActivityBuildNumGen) NextBuildNumber

func (g *PipelineActivityBuildNumGen) NextBuildNumber(pipeline kube.PipelineID) (string, error)

NextBuildNumber returns the next build number for the specified pipeline ID, storing the sequence in K8S. Returns the build number, or an error if there is a problem with K8S resources.

func (*PipelineActivityBuildNumGen) Ready

func (g *PipelineActivityBuildNumGen) Ready() bool

Ready returns true if the generator's cache has done its initial load.

Directories

Path Synopsis
matchers
Code generated by pegomock.
Code generated by pegomock.

Jump to

Keyboard shortcuts

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