consul

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulKV

type ConsulKV interface {
	Put(p *consul.KVPair, q *consul.WriteOptions) (*consul.WriteMeta, error)
	Keys(prefix, separator string, q *consul.QueryOptions) ([]string, *consul.QueryMeta, error)
	Get(key string, q *consul.QueryOptions) (*consul.KVPair, *consul.QueryMeta, error)
	Delete(key string, w *consul.WriteOptions) (*consul.WriteMeta, error)
}

consulKV describes an object that does low-level interaction with Consul

type ConsulKVOrchestrator

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

ConsulKVOrchestrator is an object that orchestrates via Consul

func NewConsulKVOrchestrator

func NewConsulKVOrchestrator(cfg *config.Consulconfig) (*ConsulKVOrchestrator, error)

NewConsulKVOrchestrator returns a new ConsulKVOrchestrator

func (*ConsulKVOrchestrator) CheckIfBuildRunning

func (cko *ConsulKVOrchestrator) CheckIfBuildRunning(id gocql.UUID) (bool, error)

CheckIfBuildRunning checks if build is listed as running in Consul

func (*ConsulKVOrchestrator) DeleteBuildCancelled

func (cko *ConsulKVOrchestrator) DeleteBuildCancelled(id gocql.UUID) error

DeleteBuildCancelled deletes a build ID from cancelled in Consul

func (*ConsulKVOrchestrator) DeleteBuildRunning

func (cko *ConsulKVOrchestrator) DeleteBuildRunning(id gocql.UUID) error

DeleteBuildRunning deletes a build ID from running in Consul

func (*ConsulKVOrchestrator) SetBuildCancelled

func (cko *ConsulKVOrchestrator) SetBuildCancelled(id gocql.UUID) error

SetBuildCancelled sets a build ID to cancelled in Consul

func (*ConsulKVOrchestrator) SetBuildRunning

func (cko *ConsulKVOrchestrator) SetBuildRunning(id gocql.UUID) error

SetBuildRunning sets a build ID to running in Consul

func (*ConsulKVOrchestrator) WatchIfBuildIsCancelled

func (cko *ConsulKVOrchestrator) WatchIfBuildIsCancelled(id gocql.UUID, timeout time.Duration) (bool, error)

WatchIfBuildIsCancelled blocks waiting for build to appear in cancelled in Consul. false is returned if timeout occurs prior to build appearing

func (*ConsulKVOrchestrator) WatchIfBuildStopsRunning

func (cko *ConsulKVOrchestrator) WatchIfBuildStopsRunning(id gocql.UUID, timeout time.Duration) (bool, error)

WatchIfBuildStopsRunning blocks waiting for build to drop off running in Consul. false is returned if timeout occurs prior to build dropping off

type KeyValueOrchestrator

type KeyValueOrchestrator interface {
	SetBuildRunning(id gocql.UUID) error
	DeleteBuildRunning(id gocql.UUID) error
	SetBuildCancelled(id gocql.UUID) error
	DeleteBuildCancelled(id gocql.UUID) error
	CheckIfBuildRunning(id gocql.UUID) (bool, error)
	WatchIfBuildStopsRunning(id gocql.UUID, timeout time.Duration) (bool, error)
	WatchIfBuildIsCancelled(id gocql.UUID, timeout time.Duration) (bool, error)
}

KeyValueOrchestrator describes an object that can orchestrate with a K/V store

Jump to

Keyboard shortcuts

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