jx: github.com/jenkins-x/jx/pkg/buildnum Index | Files | Directories

package buildnum

import "github.com/jenkins-x/jx/pkg/buildnum"

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

Package Files

build_num_gen.go http_build_num.go interface.go

Constants

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"
)

type BuildNumberIssuer Uses

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. go:generate pegomock generate github.com/jenkins-x/jx/pkg/buildnum BuildNumberIssuer -o mocks/build_num.go

type HTTPBuildNumberServer Uses

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 Uses

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 Uses

func (s *HTTPBuildNumberServer) Start() error

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

type PipelineActivityBuildNumGen Uses

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

PipelineActivityBuildNumGen generates build numbers backed by PipelineActivity K8S CRDs.

func NewCRDBuildNumGen Uses

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 Uses

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 Uses

func (g *PipelineActivityBuildNumGen) Ready() bool

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

Directories

PathSynopsis
mocks
mocks/matchersCode generated by pegomock.

Package buildnum imports 12 packages (graph) and is imported by 2 packages. Updated 2019-07-20. Refresh now. Tools for package owners.