consuladapter

package module
v0.0.0-...-ea612b3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 39

README

consuladapter

Note: This repository should be imported as code.cloudfoundry.org/consuladapter.

Tests

Checkout github action for set up and installing dependencies.

Reporting issues and requesting features

Please report all issues and feature requests in cloudfoundry/diego-release.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyNotFoundError

func NewKeyNotFoundError(key string) error

func NewPrefixNotFoundError

func NewPrefixNotFoundError(prefix string) error

func Parse

func Parse(urlArg string) (string, string, error)

Types

type Agent

type Agent interface {
	Checks() (map[string]*api.AgentCheck, error)
	Services() (map[string]*api.AgentService, error)
	ServiceRegister(service *api.AgentServiceRegistration) error
	ServiceDeregister(serviceID string) error
	PassTTL(checkID, note string) error
	WarnTTL(checkID, note string) error
	FailTTL(checkID, note string) error
	NodeName() (string, error)
	CheckDeregister(checkID string) error
}

func NewConsulAgent

func NewConsulAgent(a *api.Agent) Agent

type Catalog

type Catalog interface {
	Nodes(q *api.QueryOptions) ([]*api.Node, *api.QueryMeta, error)
}

func NewConsulCatalog

func NewConsulCatalog(c *api.Catalog) Catalog

type Client

type Client interface {
	Agent() Agent
	Session() Session
	Catalog() Catalog
	KV() KV
	Status() Status

	LockOpts(opts *api.LockOptions) (Lock, error)
}

func NewClientFromUrl

func NewClientFromUrl(urlString string) (Client, error)

func NewConsulClient

func NewConsulClient(c *api.Client) Client

func NewTLSClientFromUrl

func NewTLSClientFromUrl(urlString, caCert, clientCert, clientKey string) (Client, error)

type KV

type KV interface {
	Get(key string, q *api.QueryOptions) (*api.KVPair, *api.QueryMeta, error)
	List(prefix string, q *api.QueryOptions) (api.KVPairs, *api.QueryMeta, error)
	Put(p *api.KVPair, q *api.WriteOptions) (*api.WriteMeta, error)
	Release(p *api.KVPair, q *api.WriteOptions) (bool, *api.WriteMeta, error)
	DeleteTree(prefix string, w *api.WriteOptions) (*api.WriteMeta, error)
}

func NewConsulKV

func NewConsulKV(kv *api.KV) KV

type KeyNotFoundError

type KeyNotFoundError string

func (KeyNotFoundError) Error

func (e KeyNotFoundError) Error() string

type Lock

type Lock interface {
	Lock(stopCh <-chan struct{}) (lostLock <-chan struct{}, err error)
}

type PrefixNotFoundError

type PrefixNotFoundError string

func (PrefixNotFoundError) Error

func (e PrefixNotFoundError) Error() string

type Session

type Session interface {
	Create(se *api.SessionEntry, q *api.WriteOptions) (string, *api.WriteMeta, error)
	CreateNoChecks(se *api.SessionEntry, q *api.WriteOptions) (string, *api.WriteMeta, error)
	Destroy(id string, q *api.WriteOptions) (*api.WriteMeta, error)
	Info(id string, q *api.QueryOptions) (*api.SessionEntry, *api.QueryMeta, error)
	List(q *api.QueryOptions) ([]*api.SessionEntry, *api.QueryMeta, error)
	Node(node string, q *api.QueryOptions) ([]*api.SessionEntry, *api.QueryMeta, error)
	Renew(id string, q *api.WriteOptions) (*api.SessionEntry, *api.WriteMeta, error)
	RenewPeriodic(initialTTL string, id string, q *api.WriteOptions, doneCh chan struct{}) error
}

func NewConsulSession

func NewConsulSession(s *api.Session) Session

type Status

type Status interface {
	Leader() (string, error)
	Peers() ([]string, error)
}

func NewConsulStatus

func NewConsulStatus(s *api.Status) Status

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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