consulapi

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 18 Imported by: 1

README

consulapi

Package consulapi provides a lightweight, easy-to-use Consul client that is easy to write unit tests with.

Go Report Card Build Status GoDoc NetflixOSS Lifecycle GitHub

Project Overview

Module consulapi is a consul client library for Go programs, focused on the "90% use case". Although it is slightly feature limited compared to the official consul/api library, it brings forward an easy to use API that most consul users will appreciate.

The feature-oriented interfaces exposed by consulapi aim to be easily mockable, making it easier to write unit tests that explore all possible outcomes of an operation involving consul. Test those error conditions!

Getting Started

The consulapi module can be installed by running

$ go get gophers.dev/pkgs/consulapi
Example Usage

Creating a client is very simple - just call New with the desired ClientOptions.

client := consulapi.New(consulapi.ClientOptions{
    Address:    "https://demo.consul.io",
    Logger:     loggy.New("elector-example"),
    // see client.go for full set of options
})

members, err := client.Members()
// etc ...

Design

A few factors contribute to the simplicity of consulapi.

First, we export interfaces instead of concrete implementations. This enabled both re-implementations if necessary, as well enables the use of mocks in testing. A mock implementation for each

Second, the nature of the key-value store is significantly limited. consulapi enforces a strongly opinionated design that all keys and values must be strings, and that all keys may only be / separated. This cuts down on a lot of type casting overhead.

Third, the source code itself is intended to be easy to read and understand. It is centered around common http method calls, with the intent of being a reduced reflection of the HTTP API.

Contributing

The gophers.dev/pkgs/consulapi module is always improving with new features and error corrections. For contributing bug fixes and new features please file an issue.

License

The gophers.dev/pkgs/consulapi module is open source under the MIT license.

Documentation

Index

Constants

View Source
const (
	SessionRelease SessionTerminationBehavior = "release"
	SessionDelete  SessionTerminationBehavior = "delete"

	SessionMinimumTTL = 10 * time.Second
	SessionMaximumTTL = 86400 * time.Second

	SessionMinimumLockDelay = 0 * time.Second
	SessionMaximumLockDelay = 60 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address added in v1.1.0

type Address struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
}

type Agent

type Agent interface {

	// Self reports internal metrics specific to this running instance of the
	// consul service.
	//
	// https://www.consul.io/api/agent.html#read-configuration
	Self(ctx Ctx) (AgentInfo, error)

	// Members reports what instances of the consul service belong to the
	// consul cluster. If wan is true, the
	//
	// https://www.consul.io/api/agent.html#list-members
	Members(ctx Ctx, wan bool) ([]AgentInfo, error)

	// Reload the consul service config files.
	//
	// https://www.consul.io/api/agent.html#reload-agent
	Reload(ctx Ctx) error

	// MaintenanceMode puts a consul instance into a mode where the node is
	// marked unavailable, and will not be present in DNS or API queries.
	//
	// https://www.consul.io/api/agent.html#enable-maintenance-mode
	MaintenanceMode(ctx Ctx, enabled bool, reason string) error

	// Metrics will report about the consul instance.
	//
	// https://www.consul.io/api/agent.html#view-metrics
	Metrics(ctx Ctx) (Metrics, error)

	// Join the consul instance with an existing consul cluster.
	//
	// https://www.consul.io/api/agent.html#join-agent
	Join(ctx Ctx, address string, wan bool) error

	// Leave the consul cluster.
	//
	// https://www.consul.io/api/agent.html#graceful-leave-and-shutdown
	Leave(ctx Ctx) error

	// ForceLeave will purge the named node from the consul cluster.
	//
	// https://www.consul.io/api/agent.html#force-leave-and-shutdown
	ForceLeave(ctx Ctx, node string) error

	// SetACLToken will set the given kind of token to the value.
	//
	// https://www.consul.io/api/agent.html#update-acl-tokens
	SetACLToken(ctx Ctx, kind, token string) error
}

Agent provides an interface to information about the consul agent that is being communicated with.

type AgentInfo

type AgentInfo struct {
	Name    string            `json:"Name"`
	Address string            `json:"Addr"`
	Port    int               `json:"Port"`
	Tags    map[string]string `json:"Tags"`
}

An AgentInfo contains information about a particular consul agent.

type AgentMock added in v1.1.0

type AgentMock struct {
	ForceLeaveMock mAgentMockForceLeave

	JoinMock mAgentMockJoin

	LeaveMock mAgentMockLeave

	MaintenanceModeMock mAgentMockMaintenanceMode

	MembersMock mAgentMockMembers

	MetricsMock mAgentMockMetrics

	ReloadMock mAgentMockReload

	SelfMock mAgentMockSelf

	SetACLTokenMock mAgentMockSetACLToken
	// contains filtered or unexported fields
}

AgentMock implements Agent

func NewAgentMock added in v1.1.0

func NewAgentMock(t minimock.Tester) *AgentMock

NewAgentMock returns a mock for Agent

func (*AgentMock) ForceLeave added in v1.1.0

func (mmForceLeave *AgentMock) ForceLeave(ctx Ctx, node string) (err error)

ForceLeave implements Agent

func (*AgentMock) ForceLeaveAfterCounter added in v1.1.0

func (mmForceLeave *AgentMock) ForceLeaveAfterCounter() uint64

ForceLeaveAfterCounter returns a count of finished AgentMock.ForceLeave invocations

func (*AgentMock) ForceLeaveBeforeCounter added in v1.1.0

func (mmForceLeave *AgentMock) ForceLeaveBeforeCounter() uint64

ForceLeaveBeforeCounter returns a count of AgentMock.ForceLeave invocations

func (*AgentMock) Join added in v1.1.0

func (mmJoin *AgentMock) Join(ctx Ctx, address string, wan bool) (err error)

Join implements Agent

func (*AgentMock) JoinAfterCounter added in v1.1.0

func (mmJoin *AgentMock) JoinAfterCounter() uint64

JoinAfterCounter returns a count of finished AgentMock.Join invocations

func (*AgentMock) JoinBeforeCounter added in v1.1.0

func (mmJoin *AgentMock) JoinBeforeCounter() uint64

JoinBeforeCounter returns a count of AgentMock.Join invocations

func (*AgentMock) Leave added in v1.1.0

func (mmLeave *AgentMock) Leave(ctx Ctx) (err error)

Leave implements Agent

func (*AgentMock) LeaveAfterCounter added in v1.1.0

func (mmLeave *AgentMock) LeaveAfterCounter() uint64

LeaveAfterCounter returns a count of finished AgentMock.Leave invocations

func (*AgentMock) LeaveBeforeCounter added in v1.1.0

func (mmLeave *AgentMock) LeaveBeforeCounter() uint64

LeaveBeforeCounter returns a count of AgentMock.Leave invocations

func (*AgentMock) MaintenanceMode added in v1.1.0

func (mmMaintenanceMode *AgentMock) MaintenanceMode(ctx Ctx, enabled bool, reason string) (err error)

MaintenanceMode implements Agent

func (*AgentMock) MaintenanceModeAfterCounter added in v1.1.0

func (mmMaintenanceMode *AgentMock) MaintenanceModeAfterCounter() uint64

MaintenanceModeAfterCounter returns a count of finished AgentMock.MaintenanceMode invocations

func (*AgentMock) MaintenanceModeBeforeCounter added in v1.1.0

func (mmMaintenanceMode *AgentMock) MaintenanceModeBeforeCounter() uint64

MaintenanceModeBeforeCounter returns a count of AgentMock.MaintenanceMode invocations

func (*AgentMock) Members added in v1.1.0

func (mmMembers *AgentMock) Members(ctx Ctx, wan bool) (aa1 []AgentInfo, err error)

Members implements Agent

func (*AgentMock) MembersAfterCounter added in v1.1.0

func (mmMembers *AgentMock) MembersAfterCounter() uint64

MembersAfterCounter returns a count of finished AgentMock.Members invocations

func (*AgentMock) MembersBeforeCounter added in v1.1.0

func (mmMembers *AgentMock) MembersBeforeCounter() uint64

MembersBeforeCounter returns a count of AgentMock.Members invocations

func (*AgentMock) Metrics added in v1.1.0

func (mmMetrics *AgentMock) Metrics(ctx Ctx) (m1 Metrics, err error)

Metrics implements Agent

func (*AgentMock) MetricsAfterCounter added in v1.1.0

func (mmMetrics *AgentMock) MetricsAfterCounter() uint64

MetricsAfterCounter returns a count of finished AgentMock.Metrics invocations

func (*AgentMock) MetricsBeforeCounter added in v1.1.0

func (mmMetrics *AgentMock) MetricsBeforeCounter() uint64

MetricsBeforeCounter returns a count of AgentMock.Metrics invocations

func (*AgentMock) MinimockFinish added in v1.1.0

func (m *AgentMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*AgentMock) MinimockForceLeaveDone added in v1.1.0

func (m *AgentMock) MinimockForceLeaveDone() bool

MinimockForceLeaveDone returns true if the count of the ForceLeave invocations corresponds the number of defined expectations

func (*AgentMock) MinimockForceLeaveInspect added in v1.1.0

func (m *AgentMock) MinimockForceLeaveInspect()

MinimockForceLeaveInspect logs each unmet expectation

func (*AgentMock) MinimockJoinDone added in v1.1.0

func (m *AgentMock) MinimockJoinDone() bool

MinimockJoinDone returns true if the count of the Join invocations corresponds the number of defined expectations

func (*AgentMock) MinimockJoinInspect added in v1.1.0

func (m *AgentMock) MinimockJoinInspect()

MinimockJoinInspect logs each unmet expectation

func (*AgentMock) MinimockLeaveDone added in v1.1.0

func (m *AgentMock) MinimockLeaveDone() bool

MinimockLeaveDone returns true if the count of the Leave invocations corresponds the number of defined expectations

func (*AgentMock) MinimockLeaveInspect added in v1.1.0

func (m *AgentMock) MinimockLeaveInspect()

MinimockLeaveInspect logs each unmet expectation

func (*AgentMock) MinimockMaintenanceModeDone added in v1.1.0

func (m *AgentMock) MinimockMaintenanceModeDone() bool

MinimockMaintenanceModeDone returns true if the count of the MaintenanceMode invocations corresponds the number of defined expectations

func (*AgentMock) MinimockMaintenanceModeInspect added in v1.1.0

func (m *AgentMock) MinimockMaintenanceModeInspect()

MinimockMaintenanceModeInspect logs each unmet expectation

func (*AgentMock) MinimockMembersDone added in v1.1.0

func (m *AgentMock) MinimockMembersDone() bool

MinimockMembersDone returns true if the count of the Members invocations corresponds the number of defined expectations

func (*AgentMock) MinimockMembersInspect added in v1.1.0

func (m *AgentMock) MinimockMembersInspect()

MinimockMembersInspect logs each unmet expectation

func (*AgentMock) MinimockMetricsDone added in v1.1.0

func (m *AgentMock) MinimockMetricsDone() bool

MinimockMetricsDone returns true if the count of the Metrics invocations corresponds the number of defined expectations

func (*AgentMock) MinimockMetricsInspect added in v1.1.0

func (m *AgentMock) MinimockMetricsInspect()

MinimockMetricsInspect logs each unmet expectation

func (*AgentMock) MinimockReloadDone added in v1.1.0

func (m *AgentMock) MinimockReloadDone() bool

MinimockReloadDone returns true if the count of the Reload invocations corresponds the number of defined expectations

func (*AgentMock) MinimockReloadInspect added in v1.1.0

func (m *AgentMock) MinimockReloadInspect()

MinimockReloadInspect logs each unmet expectation

func (*AgentMock) MinimockSelfDone added in v1.1.0

func (m *AgentMock) MinimockSelfDone() bool

MinimockSelfDone returns true if the count of the Self invocations corresponds the number of defined expectations

func (*AgentMock) MinimockSelfInspect added in v1.1.0

func (m *AgentMock) MinimockSelfInspect()

MinimockSelfInspect logs each unmet expectation

func (*AgentMock) MinimockSetACLTokenDone added in v1.1.0

func (m *AgentMock) MinimockSetACLTokenDone() bool

MinimockSetACLTokenDone returns true if the count of the SetACLToken invocations corresponds the number of defined expectations

func (*AgentMock) MinimockSetACLTokenInspect added in v1.1.0

func (m *AgentMock) MinimockSetACLTokenInspect()

MinimockSetACLTokenInspect logs each unmet expectation

func (*AgentMock) MinimockWait added in v1.1.0

func (m *AgentMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*AgentMock) Reload added in v1.1.0

func (mmReload *AgentMock) Reload(ctx Ctx) (err error)

Reload implements Agent

func (*AgentMock) ReloadAfterCounter added in v1.1.0

func (mmReload *AgentMock) ReloadAfterCounter() uint64

ReloadAfterCounter returns a count of finished AgentMock.Reload invocations

func (*AgentMock) ReloadBeforeCounter added in v1.1.0

func (mmReload *AgentMock) ReloadBeforeCounter() uint64

ReloadBeforeCounter returns a count of AgentMock.Reload invocations

func (*AgentMock) Self added in v1.1.0

func (mmSelf *AgentMock) Self(ctx Ctx) (a1 AgentInfo, err error)

Self implements Agent

func (*AgentMock) SelfAfterCounter added in v1.1.0

func (mmSelf *AgentMock) SelfAfterCounter() uint64

SelfAfterCounter returns a count of finished AgentMock.Self invocations

func (*AgentMock) SelfBeforeCounter added in v1.1.0

func (mmSelf *AgentMock) SelfBeforeCounter() uint64

SelfBeforeCounter returns a count of AgentMock.Self invocations

func (*AgentMock) SetACLToken added in v1.1.0

func (mmSetACLToken *AgentMock) SetACLToken(ctx Ctx, kind string, token string) (err error)

SetACLToken implements Agent

func (*AgentMock) SetACLTokenAfterCounter added in v1.1.0

func (mmSetACLToken *AgentMock) SetACLTokenAfterCounter() uint64

SetACLTokenAfterCounter returns a count of finished AgentMock.SetACLToken invocations

func (*AgentMock) SetACLTokenBeforeCounter added in v1.1.0

func (mmSetACLToken *AgentMock) SetACLTokenBeforeCounter() uint64

SetACLTokenBeforeCounter returns a count of AgentMock.SetACLToken invocations

type AgentMockForceLeaveExpectation added in v1.1.0

type AgentMockForceLeaveExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockForceLeaveExpectation specifies expectation struct of the Agent.ForceLeave

func (*AgentMockForceLeaveExpectation) Then added in v1.1.0

Then sets up Agent.ForceLeave return parameters for the expectation previously defined by the When method

type AgentMockForceLeaveParams added in v1.1.0

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

AgentMockForceLeaveParams contains parameters of the Agent.ForceLeave

type AgentMockForceLeaveResults added in v1.1.0

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

AgentMockForceLeaveResults contains results of the Agent.ForceLeave

type AgentMockJoinExpectation added in v1.1.0

type AgentMockJoinExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockJoinExpectation specifies expectation struct of the Agent.Join

func (*AgentMockJoinExpectation) Then added in v1.1.0

Then sets up Agent.Join return parameters for the expectation previously defined by the When method

type AgentMockJoinParams added in v1.1.0

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

AgentMockJoinParams contains parameters of the Agent.Join

type AgentMockJoinResults added in v1.1.0

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

AgentMockJoinResults contains results of the Agent.Join

type AgentMockLeaveExpectation added in v1.1.0

type AgentMockLeaveExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockLeaveExpectation specifies expectation struct of the Agent.Leave

func (*AgentMockLeaveExpectation) Then added in v1.1.0

Then sets up Agent.Leave return parameters for the expectation previously defined by the When method

type AgentMockLeaveParams added in v1.1.0

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

AgentMockLeaveParams contains parameters of the Agent.Leave

type AgentMockLeaveResults added in v1.1.0

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

AgentMockLeaveResults contains results of the Agent.Leave

type AgentMockMaintenanceModeExpectation added in v1.1.0

type AgentMockMaintenanceModeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockMaintenanceModeExpectation specifies expectation struct of the Agent.MaintenanceMode

func (*AgentMockMaintenanceModeExpectation) Then added in v1.1.0

Then sets up Agent.MaintenanceMode return parameters for the expectation previously defined by the When method

type AgentMockMaintenanceModeParams added in v1.1.0

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

AgentMockMaintenanceModeParams contains parameters of the Agent.MaintenanceMode

type AgentMockMaintenanceModeResults added in v1.1.0

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

AgentMockMaintenanceModeResults contains results of the Agent.MaintenanceMode

type AgentMockMembersExpectation added in v1.1.0

type AgentMockMembersExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockMembersExpectation specifies expectation struct of the Agent.Members

func (*AgentMockMembersExpectation) Then added in v1.1.0

Then sets up Agent.Members return parameters for the expectation previously defined by the When method

type AgentMockMembersParams added in v1.1.0

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

AgentMockMembersParams contains parameters of the Agent.Members

type AgentMockMembersResults added in v1.1.0

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

AgentMockMembersResults contains results of the Agent.Members

type AgentMockMetricsExpectation added in v1.1.0

type AgentMockMetricsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockMetricsExpectation specifies expectation struct of the Agent.Metrics

func (*AgentMockMetricsExpectation) Then added in v1.1.0

Then sets up Agent.Metrics return parameters for the expectation previously defined by the When method

type AgentMockMetricsParams added in v1.1.0

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

AgentMockMetricsParams contains parameters of the Agent.Metrics

type AgentMockMetricsResults added in v1.1.0

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

AgentMockMetricsResults contains results of the Agent.Metrics

type AgentMockReloadExpectation added in v1.1.0

type AgentMockReloadExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockReloadExpectation specifies expectation struct of the Agent.Reload

func (*AgentMockReloadExpectation) Then added in v1.1.0

Then sets up Agent.Reload return parameters for the expectation previously defined by the When method

type AgentMockReloadParams added in v1.1.0

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

AgentMockReloadParams contains parameters of the Agent.Reload

type AgentMockReloadResults added in v1.1.0

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

AgentMockReloadResults contains results of the Agent.Reload

type AgentMockSelfExpectation added in v1.1.0

type AgentMockSelfExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockSelfExpectation specifies expectation struct of the Agent.Self

func (*AgentMockSelfExpectation) Then added in v1.1.0

Then sets up Agent.Self return parameters for the expectation previously defined by the When method

type AgentMockSelfParams added in v1.1.0

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

AgentMockSelfParams contains parameters of the Agent.Self

type AgentMockSelfResults added in v1.1.0

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

AgentMockSelfResults contains results of the Agent.Self

type AgentMockSetACLTokenExpectation added in v1.1.0

type AgentMockSetACLTokenExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AgentMockSetACLTokenExpectation specifies expectation struct of the Agent.SetACLToken

func (*AgentMockSetACLTokenExpectation) Then added in v1.1.0

Then sets up Agent.SetACLToken return parameters for the expectation previously defined by the When method

type AgentMockSetACLTokenParams added in v1.1.0

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

AgentMockSetACLTokenParams contains parameters of the Agent.SetACLToken

type AgentMockSetACLTokenResults added in v1.1.0

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

AgentMockSetACLTokenResults contains results of the Agent.SetACLToken

type AsLeaderFunc

type AsLeaderFunc func(Ctx) error

AsLeaderFunc is executed when the client is able to acquire the underlying consul leader lock. When a value is sent on context.Done, this client is no longer the elected leader and must cease any operations that require leadership. A reasonable implementation will return from the function as soon as possible context cancellation.

If the implementation returns from the function before the context is cancelled, leadership will be abdicated, the context will be cancelled, and no further action should be taken until elected leader again.

type Candidate

type Candidate interface {
	Participate(Ctx, LeadershipConfig, AsLeaderFunc) (LeaderSession, error)
}

A Candidate implementation is able to Participate in leadership elections.

type CandidateMock added in v1.1.0

type CandidateMock struct {
	ParticipateMock mCandidateMockParticipate
	// contains filtered or unexported fields
}

CandidateMock implements Candidate

func NewCandidateMock added in v1.1.0

func NewCandidateMock(t minimock.Tester) *CandidateMock

NewCandidateMock returns a mock for Candidate

func (*CandidateMock) MinimockFinish added in v1.1.0

func (m *CandidateMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*CandidateMock) MinimockParticipateDone added in v1.1.0

func (m *CandidateMock) MinimockParticipateDone() bool

MinimockParticipateDone returns true if the count of the Participate invocations corresponds the number of defined expectations

func (*CandidateMock) MinimockParticipateInspect added in v1.1.0

func (m *CandidateMock) MinimockParticipateInspect()

MinimockParticipateInspect logs each unmet expectation

func (*CandidateMock) MinimockWait added in v1.1.0

func (m *CandidateMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*CandidateMock) Participate added in v1.1.0

func (mmParticipate *CandidateMock) Participate(c1 Ctx, l1 LeadershipConfig, a1 AsLeaderFunc) (l2 LeaderSession, err error)

Participate implements Candidate

func (*CandidateMock) ParticipateAfterCounter added in v1.1.0

func (mmParticipate *CandidateMock) ParticipateAfterCounter() uint64

ParticipateAfterCounter returns a count of finished CandidateMock.Participate invocations

func (*CandidateMock) ParticipateBeforeCounter added in v1.1.0

func (mmParticipate *CandidateMock) ParticipateBeforeCounter() uint64

ParticipateBeforeCounter returns a count of CandidateMock.Participate invocations

type CandidateMockParticipateExpectation added in v1.1.0

type CandidateMockParticipateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CandidateMockParticipateExpectation specifies expectation struct of the Candidate.Participate

func (*CandidateMockParticipateExpectation) Then added in v1.1.0

Then sets up Candidate.Participate return parameters for the expectation previously defined by the When method

type CandidateMockParticipateParams added in v1.1.0

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

CandidateMockParticipateParams contains parameters of the Candidate.Participate

type CandidateMockParticipateResults added in v1.1.0

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

CandidateMockParticipateResults contains results of the Candidate.Participate

type Catalog

type Catalog interface {

	// DataCenters returns the list of all known DCs. The order of the
	// list of DCs is in estimated round trip distance (i.e. the dcs
	// furthest away are listed last).
	//
	// https://www.consul.io/api/catalog.html#list-datacenters
	DataCenters(Ctx) ([]string, error)

	// Nodes will return the list of nodes in dc.
	//
	// https://www.consul.io/api/catalog.html#list-nodes
	Nodes(Ctx, NodesQuery) ([]Node, error)

	// Node will return detailed meta information associated
	// a particular node in dc.
	//
	// https://www.consul.io/api/catalog.html#list-services-for-node
	Node(Ctx, string, NodeQuery) (NodeInfo, error)

	// Services will return a list of names of services
	// in dc, along with the associated tags for each service.
	//
	// https://www.consul.io/api/catalog.html#list-services
	Services(Ctx, ServicesQuery) (map[string][]string, error)

	// Service returns detailed meta information about a particular
	// named service, in dc, which matches all of the listed tags.
	//
	// https://www.consul.io/api/catalog.html#list-nodes-for-service
	Service(Ctx, string, ServiceQuery) ([]Instance, error)

	// Connect returns the detailed meta information about a particular
	// consul CONNECT enabled service in a given DC.
	//
	// https://www.consul.io/api/catalog.html#list-nodes-for-connect-capable-service
	Connect(Ctx, string, ServiceQuery) ([]Instance, error)
}

A Catalog represents the consul catalog feature.

Note that the register and deregister endpoints are not implemented. Per the consul documentation, it is preferable to make use of the Agent endpoints for service registrations.

type CatalogMock added in v1.1.0

type CatalogMock struct {
	ConnectMock mCatalogMockConnect

	DataCentersMock mCatalogMockDataCenters

	NodeMock mCatalogMockNode

	NodesMock mCatalogMockNodes

	ServiceMock mCatalogMockService

	ServicesMock mCatalogMockServices
	// contains filtered or unexported fields
}

CatalogMock implements Catalog

func NewCatalogMock added in v1.1.0

func NewCatalogMock(t minimock.Tester) *CatalogMock

NewCatalogMock returns a mock for Catalog

func (*CatalogMock) Connect added in v1.1.0

func (mmConnect *CatalogMock) Connect(c1 Ctx, s1 string, s2 ServiceQuery) (ia1 []Instance, err error)

Connect implements Catalog

func (*CatalogMock) ConnectAfterCounter added in v1.1.0

func (mmConnect *CatalogMock) ConnectAfterCounter() uint64

ConnectAfterCounter returns a count of finished CatalogMock.Connect invocations

func (*CatalogMock) ConnectBeforeCounter added in v1.1.0

func (mmConnect *CatalogMock) ConnectBeforeCounter() uint64

ConnectBeforeCounter returns a count of CatalogMock.Connect invocations

func (*CatalogMock) DataCenters added in v1.1.0

func (mmDataCenters *CatalogMock) DataCenters(c1 Ctx) (sa1 []string, err error)

DataCenters implements Catalog

func (*CatalogMock) DataCentersAfterCounter added in v1.1.0

func (mmDataCenters *CatalogMock) DataCentersAfterCounter() uint64

DataCentersAfterCounter returns a count of finished CatalogMock.DataCenters invocations

func (*CatalogMock) DataCentersBeforeCounter added in v1.1.0

func (mmDataCenters *CatalogMock) DataCentersBeforeCounter() uint64

DataCentersBeforeCounter returns a count of CatalogMock.DataCenters invocations

func (*CatalogMock) MinimockConnectDone added in v1.1.0

func (m *CatalogMock) MinimockConnectDone() bool

MinimockConnectDone returns true if the count of the Connect invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockConnectInspect added in v1.1.0

func (m *CatalogMock) MinimockConnectInspect()

MinimockConnectInspect logs each unmet expectation

func (*CatalogMock) MinimockDataCentersDone added in v1.1.0

func (m *CatalogMock) MinimockDataCentersDone() bool

MinimockDataCentersDone returns true if the count of the DataCenters invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockDataCentersInspect added in v1.1.0

func (m *CatalogMock) MinimockDataCentersInspect()

MinimockDataCentersInspect logs each unmet expectation

func (*CatalogMock) MinimockFinish added in v1.1.0

func (m *CatalogMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*CatalogMock) MinimockNodeDone added in v1.1.0

func (m *CatalogMock) MinimockNodeDone() bool

MinimockNodeDone returns true if the count of the Node invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockNodeInspect added in v1.1.0

func (m *CatalogMock) MinimockNodeInspect()

MinimockNodeInspect logs each unmet expectation

func (*CatalogMock) MinimockNodesDone added in v1.1.0

func (m *CatalogMock) MinimockNodesDone() bool

MinimockNodesDone returns true if the count of the Nodes invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockNodesInspect added in v1.1.0

func (m *CatalogMock) MinimockNodesInspect()

MinimockNodesInspect logs each unmet expectation

func (*CatalogMock) MinimockServiceDone added in v1.1.0

func (m *CatalogMock) MinimockServiceDone() bool

MinimockServiceDone returns true if the count of the Service invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockServiceInspect added in v1.1.0

func (m *CatalogMock) MinimockServiceInspect()

MinimockServiceInspect logs each unmet expectation

func (*CatalogMock) MinimockServicesDone added in v1.1.0

func (m *CatalogMock) MinimockServicesDone() bool

MinimockServicesDone returns true if the count of the Services invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockServicesInspect added in v1.1.0

func (m *CatalogMock) MinimockServicesInspect()

MinimockServicesInspect logs each unmet expectation

func (*CatalogMock) MinimockWait added in v1.1.0

func (m *CatalogMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*CatalogMock) Node added in v1.1.0

func (mmNode *CatalogMock) Node(c1 Ctx, s1 string, n1 NodeQuery) (n2 NodeInfo, err error)

Node implements Catalog

func (*CatalogMock) NodeAfterCounter added in v1.1.0

func (mmNode *CatalogMock) NodeAfterCounter() uint64

NodeAfterCounter returns a count of finished CatalogMock.Node invocations

func (*CatalogMock) NodeBeforeCounter added in v1.1.0

func (mmNode *CatalogMock) NodeBeforeCounter() uint64

NodeBeforeCounter returns a count of CatalogMock.Node invocations

func (*CatalogMock) Nodes added in v1.1.0

func (mmNodes *CatalogMock) Nodes(c1 Ctx, n1 NodesQuery) (na1 []Node, err error)

Nodes implements Catalog

func (*CatalogMock) NodesAfterCounter added in v1.1.0

func (mmNodes *CatalogMock) NodesAfterCounter() uint64

NodesAfterCounter returns a count of finished CatalogMock.Nodes invocations

func (*CatalogMock) NodesBeforeCounter added in v1.1.0

func (mmNodes *CatalogMock) NodesBeforeCounter() uint64

NodesBeforeCounter returns a count of CatalogMock.Nodes invocations

func (*CatalogMock) Service added in v1.1.0

func (mmService *CatalogMock) Service(c1 Ctx, s1 string, s2 ServiceQuery) (ia1 []Instance, err error)

Service implements Catalog

func (*CatalogMock) ServiceAfterCounter added in v1.1.0

func (mmService *CatalogMock) ServiceAfterCounter() uint64

ServiceAfterCounter returns a count of finished CatalogMock.Service invocations

func (*CatalogMock) ServiceBeforeCounter added in v1.1.0

func (mmService *CatalogMock) ServiceBeforeCounter() uint64

ServiceBeforeCounter returns a count of CatalogMock.Service invocations

func (*CatalogMock) Services added in v1.1.0

func (mmServices *CatalogMock) Services(c1 Ctx, s1 ServicesQuery) (m1 map[string][]string, err error)

Services implements Catalog

func (*CatalogMock) ServicesAfterCounter added in v1.1.0

func (mmServices *CatalogMock) ServicesAfterCounter() uint64

ServicesAfterCounter returns a count of finished CatalogMock.Services invocations

func (*CatalogMock) ServicesBeforeCounter added in v1.1.0

func (mmServices *CatalogMock) ServicesBeforeCounter() uint64

ServicesBeforeCounter returns a count of CatalogMock.Services invocations

type CatalogMockConnectExpectation added in v1.1.0

type CatalogMockConnectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockConnectExpectation specifies expectation struct of the Catalog.Connect

func (*CatalogMockConnectExpectation) Then added in v1.1.0

Then sets up Catalog.Connect return parameters for the expectation previously defined by the When method

type CatalogMockConnectParams added in v1.1.0

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

CatalogMockConnectParams contains parameters of the Catalog.Connect

type CatalogMockConnectResults added in v1.1.0

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

CatalogMockConnectResults contains results of the Catalog.Connect

type CatalogMockDataCentersExpectation added in v1.1.0

type CatalogMockDataCentersExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockDataCentersExpectation specifies expectation struct of the Catalog.DataCenters

func (*CatalogMockDataCentersExpectation) Then added in v1.1.0

Then sets up Catalog.DataCenters return parameters for the expectation previously defined by the When method

type CatalogMockDataCentersParams added in v1.1.0

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

CatalogMockDataCentersParams contains parameters of the Catalog.DataCenters

type CatalogMockDataCentersResults added in v1.1.0

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

CatalogMockDataCentersResults contains results of the Catalog.DataCenters

type CatalogMockNodeExpectation added in v1.1.0

type CatalogMockNodeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockNodeExpectation specifies expectation struct of the Catalog.Node

func (*CatalogMockNodeExpectation) Then added in v1.1.0

Then sets up Catalog.Node return parameters for the expectation previously defined by the When method

type CatalogMockNodeParams added in v1.1.0

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

CatalogMockNodeParams contains parameters of the Catalog.Node

type CatalogMockNodeResults added in v1.1.0

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

CatalogMockNodeResults contains results of the Catalog.Node

type CatalogMockNodesExpectation added in v1.1.0

type CatalogMockNodesExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockNodesExpectation specifies expectation struct of the Catalog.Nodes

func (*CatalogMockNodesExpectation) Then added in v1.1.0

func (e *CatalogMockNodesExpectation) Then(na1 []Node, err error) *CatalogMock

Then sets up Catalog.Nodes return parameters for the expectation previously defined by the When method

type CatalogMockNodesParams added in v1.1.0

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

CatalogMockNodesParams contains parameters of the Catalog.Nodes

type CatalogMockNodesResults added in v1.1.0

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

CatalogMockNodesResults contains results of the Catalog.Nodes

type CatalogMockServiceExpectation added in v1.1.0

type CatalogMockServiceExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockServiceExpectation specifies expectation struct of the Catalog.Service

func (*CatalogMockServiceExpectation) Then added in v1.1.0

Then sets up Catalog.Service return parameters for the expectation previously defined by the When method

type CatalogMockServiceParams added in v1.1.0

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

CatalogMockServiceParams contains parameters of the Catalog.Service

type CatalogMockServiceResults added in v1.1.0

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

CatalogMockServiceResults contains results of the Catalog.Service

type CatalogMockServicesExpectation added in v1.1.0

type CatalogMockServicesExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockServicesExpectation specifies expectation struct of the Catalog.Services

func (*CatalogMockServicesExpectation) Then added in v1.1.0

Then sets up Catalog.Services return parameters for the expectation previously defined by the When method

type CatalogMockServicesParams added in v1.1.0

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

CatalogMockServicesParams contains parameters of the Catalog.Services

type CatalogMockServicesResults added in v1.1.0

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

CatalogMockServicesResults contains results of the Catalog.Services

type Client

type Client interface {
	Agent
	Catalog
	KV
	Session
	Candidate
}

A Client is used to communicate with consul. The interface is composed of other interfaces, which reflect the different categories of API supported by the consul agent.

func New

func New(opts ClientOptions) Client

New creates a new Client that will use the provided ClientOptions for making requests to a configured consul agent.

type ClientMock added in v1.1.0

type ClientMock struct {
	ConnectMock mClientMockConnect

	CreateSessionMock mClientMockCreateSession

	DataCentersMock mClientMockDataCenters

	DeleteMock mClientMockDelete

	DeleteSessionMock mClientMockDeleteSession

	ForceLeaveMock mClientMockForceLeave

	GetMock mClientMockGet

	JoinMock mClientMockJoin

	KeysMock mClientMockKeys

	LeaveMock mClientMockLeave

	ListSessionsMock mClientMockListSessions

	MaintenanceModeMock mClientMockMaintenanceMode

	MembersMock mClientMockMembers

	MetricsMock mClientMockMetrics

	NodeMock mClientMockNode

	NodesMock mClientMockNodes

	ParticipateMock mClientMockParticipate

	PutMock mClientMockPut

	ReadSessionMock mClientMockReadSession

	RecurseMock mClientMockRecurse

	ReloadMock mClientMockReload

	RenewSessionMock mClientMockRenewSession

	SelfMock mClientMockSelf

	ServiceMock mClientMockService

	ServicesMock mClientMockServices

	SetACLTokenMock mClientMockSetACLToken
	// contains filtered or unexported fields
}

ClientMock implements Client

func NewClientMock added in v1.1.0

func NewClientMock(t minimock.Tester) *ClientMock

NewClientMock returns a mock for Client

func (*ClientMock) Connect added in v1.1.0

func (mmConnect *ClientMock) Connect(c1 Ctx, s1 string, s2 ServiceQuery) (ia1 []Instance, err error)

Connect implements Client

func (*ClientMock) ConnectAfterCounter added in v1.1.0

func (mmConnect *ClientMock) ConnectAfterCounter() uint64

ConnectAfterCounter returns a count of finished ClientMock.Connect invocations

func (*ClientMock) ConnectBeforeCounter added in v1.1.0

func (mmConnect *ClientMock) ConnectBeforeCounter() uint64

ConnectBeforeCounter returns a count of ClientMock.Connect invocations

func (*ClientMock) CreateSession added in v1.1.0

func (mmCreateSession *ClientMock) CreateSession(c1 Ctx, s1 SessionConfig) (s2 SessionID, err error)

CreateSession implements Client

func (*ClientMock) CreateSessionAfterCounter added in v1.1.0

func (mmCreateSession *ClientMock) CreateSessionAfterCounter() uint64

CreateSessionAfterCounter returns a count of finished ClientMock.CreateSession invocations

func (*ClientMock) CreateSessionBeforeCounter added in v1.1.0

func (mmCreateSession *ClientMock) CreateSessionBeforeCounter() uint64

CreateSessionBeforeCounter returns a count of ClientMock.CreateSession invocations

func (*ClientMock) DataCenters added in v1.1.0

func (mmDataCenters *ClientMock) DataCenters(c1 Ctx) (sa1 []string, err error)

DataCenters implements Client

func (*ClientMock) DataCentersAfterCounter added in v1.1.0

func (mmDataCenters *ClientMock) DataCentersAfterCounter() uint64

DataCentersAfterCounter returns a count of finished ClientMock.DataCenters invocations

func (*ClientMock) DataCentersBeforeCounter added in v1.1.0

func (mmDataCenters *ClientMock) DataCentersBeforeCounter() uint64

DataCentersBeforeCounter returns a count of ClientMock.DataCenters invocations

func (*ClientMock) Delete added in v1.1.0

func (mmDelete *ClientMock) Delete(c1 Ctx, s1 string, q1 Query) (err error)

Delete implements Client

func (*ClientMock) DeleteAfterCounter added in v1.1.0

func (mmDelete *ClientMock) DeleteAfterCounter() uint64

DeleteAfterCounter returns a count of finished ClientMock.Delete invocations

func (*ClientMock) DeleteBeforeCounter added in v1.1.0

func (mmDelete *ClientMock) DeleteBeforeCounter() uint64

DeleteBeforeCounter returns a count of ClientMock.Delete invocations

func (*ClientMock) DeleteSession added in v1.1.0

func (mmDeleteSession *ClientMock) DeleteSession(c1 Ctx, s1 SessionQuery) (err error)

DeleteSession implements Client

func (*ClientMock) DeleteSessionAfterCounter added in v1.1.0

func (mmDeleteSession *ClientMock) DeleteSessionAfterCounter() uint64

DeleteSessionAfterCounter returns a count of finished ClientMock.DeleteSession invocations

func (*ClientMock) DeleteSessionBeforeCounter added in v1.1.0

func (mmDeleteSession *ClientMock) DeleteSessionBeforeCounter() uint64

DeleteSessionBeforeCounter returns a count of ClientMock.DeleteSession invocations

func (*ClientMock) ForceLeave added in v1.1.0

func (mmForceLeave *ClientMock) ForceLeave(ctx Ctx, node string) (err error)

ForceLeave implements Client

func (*ClientMock) ForceLeaveAfterCounter added in v1.1.0

func (mmForceLeave *ClientMock) ForceLeaveAfterCounter() uint64

ForceLeaveAfterCounter returns a count of finished ClientMock.ForceLeave invocations

func (*ClientMock) ForceLeaveBeforeCounter added in v1.1.0

func (mmForceLeave *ClientMock) ForceLeaveBeforeCounter() uint64

ForceLeaveBeforeCounter returns a count of ClientMock.ForceLeave invocations

func (*ClientMock) Get added in v1.1.0

func (mmGet *ClientMock) Get(c1 Ctx, s1 string, q1 Query) (s2 string, err error)

Get implements Client

func (*ClientMock) GetAfterCounter added in v1.1.0

func (mmGet *ClientMock) GetAfterCounter() uint64

GetAfterCounter returns a count of finished ClientMock.Get invocations

func (*ClientMock) GetBeforeCounter added in v1.1.0

func (mmGet *ClientMock) GetBeforeCounter() uint64

GetBeforeCounter returns a count of ClientMock.Get invocations

func (*ClientMock) Join added in v1.1.0

func (mmJoin *ClientMock) Join(ctx Ctx, address string, wan bool) (err error)

Join implements Client

func (*ClientMock) JoinAfterCounter added in v1.1.0

func (mmJoin *ClientMock) JoinAfterCounter() uint64

JoinAfterCounter returns a count of finished ClientMock.Join invocations

func (*ClientMock) JoinBeforeCounter added in v1.1.0

func (mmJoin *ClientMock) JoinBeforeCounter() uint64

JoinBeforeCounter returns a count of ClientMock.Join invocations

func (*ClientMock) Keys added in v1.1.0

func (mmKeys *ClientMock) Keys(c1 Ctx, s1 string, q1 Query) (sa1 []string, err error)

Keys implements Client

func (*ClientMock) KeysAfterCounter added in v1.1.0

func (mmKeys *ClientMock) KeysAfterCounter() uint64

KeysAfterCounter returns a count of finished ClientMock.Keys invocations

func (*ClientMock) KeysBeforeCounter added in v1.1.0

func (mmKeys *ClientMock) KeysBeforeCounter() uint64

KeysBeforeCounter returns a count of ClientMock.Keys invocations

func (*ClientMock) Leave added in v1.1.0

func (mmLeave *ClientMock) Leave(ctx Ctx) (err error)

Leave implements Client

func (*ClientMock) LeaveAfterCounter added in v1.1.0

func (mmLeave *ClientMock) LeaveAfterCounter() uint64

LeaveAfterCounter returns a count of finished ClientMock.Leave invocations

func (*ClientMock) LeaveBeforeCounter added in v1.1.0

func (mmLeave *ClientMock) LeaveBeforeCounter() uint64

LeaveBeforeCounter returns a count of ClientMock.Leave invocations

func (*ClientMock) ListSessions added in v1.1.0

func (mmListSessions *ClientMock) ListSessions(ctx Ctx, dc string, node string) (m1 map[SessionID]SessionConfig, err error)

ListSessions implements Client

func (*ClientMock) ListSessionsAfterCounter added in v1.1.0

func (mmListSessions *ClientMock) ListSessionsAfterCounter() uint64

ListSessionsAfterCounter returns a count of finished ClientMock.ListSessions invocations

func (*ClientMock) ListSessionsBeforeCounter added in v1.1.0

func (mmListSessions *ClientMock) ListSessionsBeforeCounter() uint64

ListSessionsBeforeCounter returns a count of ClientMock.ListSessions invocations

func (*ClientMock) MaintenanceMode added in v1.1.0

func (mmMaintenanceMode *ClientMock) MaintenanceMode(ctx Ctx, enabled bool, reason string) (err error)

MaintenanceMode implements Client

func (*ClientMock) MaintenanceModeAfterCounter added in v1.1.0

func (mmMaintenanceMode *ClientMock) MaintenanceModeAfterCounter() uint64

MaintenanceModeAfterCounter returns a count of finished ClientMock.MaintenanceMode invocations

func (*ClientMock) MaintenanceModeBeforeCounter added in v1.1.0

func (mmMaintenanceMode *ClientMock) MaintenanceModeBeforeCounter() uint64

MaintenanceModeBeforeCounter returns a count of ClientMock.MaintenanceMode invocations

func (*ClientMock) Members added in v1.1.0

func (mmMembers *ClientMock) Members(ctx Ctx, wan bool) (aa1 []AgentInfo, err error)

Members implements Client

func (*ClientMock) MembersAfterCounter added in v1.1.0

func (mmMembers *ClientMock) MembersAfterCounter() uint64

MembersAfterCounter returns a count of finished ClientMock.Members invocations

func (*ClientMock) MembersBeforeCounter added in v1.1.0

func (mmMembers *ClientMock) MembersBeforeCounter() uint64

MembersBeforeCounter returns a count of ClientMock.Members invocations

func (*ClientMock) Metrics added in v1.1.0

func (mmMetrics *ClientMock) Metrics(ctx Ctx) (m1 Metrics, err error)

Metrics implements Client

func (*ClientMock) MetricsAfterCounter added in v1.1.0

func (mmMetrics *ClientMock) MetricsAfterCounter() uint64

MetricsAfterCounter returns a count of finished ClientMock.Metrics invocations

func (*ClientMock) MetricsBeforeCounter added in v1.1.0

func (mmMetrics *ClientMock) MetricsBeforeCounter() uint64

MetricsBeforeCounter returns a count of ClientMock.Metrics invocations

func (*ClientMock) MinimockConnectDone added in v1.1.0

func (m *ClientMock) MinimockConnectDone() bool

MinimockConnectDone returns true if the count of the Connect invocations corresponds the number of defined expectations

func (*ClientMock) MinimockConnectInspect added in v1.1.0

func (m *ClientMock) MinimockConnectInspect()

MinimockConnectInspect logs each unmet expectation

func (*ClientMock) MinimockCreateSessionDone added in v1.1.0

func (m *ClientMock) MinimockCreateSessionDone() bool

MinimockCreateSessionDone returns true if the count of the CreateSession invocations corresponds the number of defined expectations

func (*ClientMock) MinimockCreateSessionInspect added in v1.1.0

func (m *ClientMock) MinimockCreateSessionInspect()

MinimockCreateSessionInspect logs each unmet expectation

func (*ClientMock) MinimockDataCentersDone added in v1.1.0

func (m *ClientMock) MinimockDataCentersDone() bool

MinimockDataCentersDone returns true if the count of the DataCenters invocations corresponds the number of defined expectations

func (*ClientMock) MinimockDataCentersInspect added in v1.1.0

func (m *ClientMock) MinimockDataCentersInspect()

MinimockDataCentersInspect logs each unmet expectation

func (*ClientMock) MinimockDeleteDone added in v1.1.0

func (m *ClientMock) MinimockDeleteDone() bool

MinimockDeleteDone returns true if the count of the Delete invocations corresponds the number of defined expectations

func (*ClientMock) MinimockDeleteInspect added in v1.1.0

func (m *ClientMock) MinimockDeleteInspect()

MinimockDeleteInspect logs each unmet expectation

func (*ClientMock) MinimockDeleteSessionDone added in v1.1.0

func (m *ClientMock) MinimockDeleteSessionDone() bool

MinimockDeleteSessionDone returns true if the count of the DeleteSession invocations corresponds the number of defined expectations

func (*ClientMock) MinimockDeleteSessionInspect added in v1.1.0

func (m *ClientMock) MinimockDeleteSessionInspect()

MinimockDeleteSessionInspect logs each unmet expectation

func (*ClientMock) MinimockFinish added in v1.1.0

func (m *ClientMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*ClientMock) MinimockForceLeaveDone added in v1.1.0

func (m *ClientMock) MinimockForceLeaveDone() bool

MinimockForceLeaveDone returns true if the count of the ForceLeave invocations corresponds the number of defined expectations

func (*ClientMock) MinimockForceLeaveInspect added in v1.1.0

func (m *ClientMock) MinimockForceLeaveInspect()

MinimockForceLeaveInspect logs each unmet expectation

func (*ClientMock) MinimockGetDone added in v1.1.0

func (m *ClientMock) MinimockGetDone() bool

MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations

func (*ClientMock) MinimockGetInspect added in v1.1.0

func (m *ClientMock) MinimockGetInspect()

MinimockGetInspect logs each unmet expectation

func (*ClientMock) MinimockJoinDone added in v1.1.0

func (m *ClientMock) MinimockJoinDone() bool

MinimockJoinDone returns true if the count of the Join invocations corresponds the number of defined expectations

func (*ClientMock) MinimockJoinInspect added in v1.1.0

func (m *ClientMock) MinimockJoinInspect()

MinimockJoinInspect logs each unmet expectation

func (*ClientMock) MinimockKeysDone added in v1.1.0

func (m *ClientMock) MinimockKeysDone() bool

MinimockKeysDone returns true if the count of the Keys invocations corresponds the number of defined expectations

func (*ClientMock) MinimockKeysInspect added in v1.1.0

func (m *ClientMock) MinimockKeysInspect()

MinimockKeysInspect logs each unmet expectation

func (*ClientMock) MinimockLeaveDone added in v1.1.0

func (m *ClientMock) MinimockLeaveDone() bool

MinimockLeaveDone returns true if the count of the Leave invocations corresponds the number of defined expectations

func (*ClientMock) MinimockLeaveInspect added in v1.1.0

func (m *ClientMock) MinimockLeaveInspect()

MinimockLeaveInspect logs each unmet expectation

func (*ClientMock) MinimockListSessionsDone added in v1.1.0

func (m *ClientMock) MinimockListSessionsDone() bool

MinimockListSessionsDone returns true if the count of the ListSessions invocations corresponds the number of defined expectations

func (*ClientMock) MinimockListSessionsInspect added in v1.1.0

func (m *ClientMock) MinimockListSessionsInspect()

MinimockListSessionsInspect logs each unmet expectation

func (*ClientMock) MinimockMaintenanceModeDone added in v1.1.0

func (m *ClientMock) MinimockMaintenanceModeDone() bool

MinimockMaintenanceModeDone returns true if the count of the MaintenanceMode invocations corresponds the number of defined expectations

func (*ClientMock) MinimockMaintenanceModeInspect added in v1.1.0

func (m *ClientMock) MinimockMaintenanceModeInspect()

MinimockMaintenanceModeInspect logs each unmet expectation

func (*ClientMock) MinimockMembersDone added in v1.1.0

func (m *ClientMock) MinimockMembersDone() bool

MinimockMembersDone returns true if the count of the Members invocations corresponds the number of defined expectations

func (*ClientMock) MinimockMembersInspect added in v1.1.0

func (m *ClientMock) MinimockMembersInspect()

MinimockMembersInspect logs each unmet expectation

func (*ClientMock) MinimockMetricsDone added in v1.1.0

func (m *ClientMock) MinimockMetricsDone() bool

MinimockMetricsDone returns true if the count of the Metrics invocations corresponds the number of defined expectations

func (*ClientMock) MinimockMetricsInspect added in v1.1.0

func (m *ClientMock) MinimockMetricsInspect()

MinimockMetricsInspect logs each unmet expectation

func (*ClientMock) MinimockNodeDone added in v1.1.0

func (m *ClientMock) MinimockNodeDone() bool

MinimockNodeDone returns true if the count of the Node invocations corresponds the number of defined expectations

func (*ClientMock) MinimockNodeInspect added in v1.1.0

func (m *ClientMock) MinimockNodeInspect()

MinimockNodeInspect logs each unmet expectation

func (*ClientMock) MinimockNodesDone added in v1.1.0

func (m *ClientMock) MinimockNodesDone() bool

MinimockNodesDone returns true if the count of the Nodes invocations corresponds the number of defined expectations

func (*ClientMock) MinimockNodesInspect added in v1.1.0

func (m *ClientMock) MinimockNodesInspect()

MinimockNodesInspect logs each unmet expectation

func (*ClientMock) MinimockParticipateDone added in v1.1.0

func (m *ClientMock) MinimockParticipateDone() bool

MinimockParticipateDone returns true if the count of the Participate invocations corresponds the number of defined expectations

func (*ClientMock) MinimockParticipateInspect added in v1.1.0

func (m *ClientMock) MinimockParticipateInspect()

MinimockParticipateInspect logs each unmet expectation

func (*ClientMock) MinimockPutDone added in v1.1.0

func (m *ClientMock) MinimockPutDone() bool

MinimockPutDone returns true if the count of the Put invocations corresponds the number of defined expectations

func (*ClientMock) MinimockPutInspect added in v1.1.0

func (m *ClientMock) MinimockPutInspect()

MinimockPutInspect logs each unmet expectation

func (*ClientMock) MinimockReadSessionDone added in v1.1.0

func (m *ClientMock) MinimockReadSessionDone() bool

MinimockReadSessionDone returns true if the count of the ReadSession invocations corresponds the number of defined expectations

func (*ClientMock) MinimockReadSessionInspect added in v1.1.0

func (m *ClientMock) MinimockReadSessionInspect()

MinimockReadSessionInspect logs each unmet expectation

func (*ClientMock) MinimockRecurseDone added in v1.1.0

func (m *ClientMock) MinimockRecurseDone() bool

MinimockRecurseDone returns true if the count of the Recurse invocations corresponds the number of defined expectations

func (*ClientMock) MinimockRecurseInspect added in v1.1.0

func (m *ClientMock) MinimockRecurseInspect()

MinimockRecurseInspect logs each unmet expectation

func (*ClientMock) MinimockReloadDone added in v1.1.0

func (m *ClientMock) MinimockReloadDone() bool

MinimockReloadDone returns true if the count of the Reload invocations corresponds the number of defined expectations

func (*ClientMock) MinimockReloadInspect added in v1.1.0

func (m *ClientMock) MinimockReloadInspect()

MinimockReloadInspect logs each unmet expectation

func (*ClientMock) MinimockRenewSessionDone added in v1.1.0

func (m *ClientMock) MinimockRenewSessionDone() bool

MinimockRenewSessionDone returns true if the count of the RenewSession invocations corresponds the number of defined expectations

func (*ClientMock) MinimockRenewSessionInspect added in v1.1.0

func (m *ClientMock) MinimockRenewSessionInspect()

MinimockRenewSessionInspect logs each unmet expectation

func (*ClientMock) MinimockSelfDone added in v1.1.0

func (m *ClientMock) MinimockSelfDone() bool

MinimockSelfDone returns true if the count of the Self invocations corresponds the number of defined expectations

func (*ClientMock) MinimockSelfInspect added in v1.1.0

func (m *ClientMock) MinimockSelfInspect()

MinimockSelfInspect logs each unmet expectation

func (*ClientMock) MinimockServiceDone added in v1.1.0

func (m *ClientMock) MinimockServiceDone() bool

MinimockServiceDone returns true if the count of the Service invocations corresponds the number of defined expectations

func (*ClientMock) MinimockServiceInspect added in v1.1.0

func (m *ClientMock) MinimockServiceInspect()

MinimockServiceInspect logs each unmet expectation

func (*ClientMock) MinimockServicesDone added in v1.1.0

func (m *ClientMock) MinimockServicesDone() bool

MinimockServicesDone returns true if the count of the Services invocations corresponds the number of defined expectations

func (*ClientMock) MinimockServicesInspect added in v1.1.0

func (m *ClientMock) MinimockServicesInspect()

MinimockServicesInspect logs each unmet expectation

func (*ClientMock) MinimockSetACLTokenDone added in v1.1.0

func (m *ClientMock) MinimockSetACLTokenDone() bool

MinimockSetACLTokenDone returns true if the count of the SetACLToken invocations corresponds the number of defined expectations

func (*ClientMock) MinimockSetACLTokenInspect added in v1.1.0

func (m *ClientMock) MinimockSetACLTokenInspect()

MinimockSetACLTokenInspect logs each unmet expectation

func (*ClientMock) MinimockWait added in v1.1.0

func (m *ClientMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*ClientMock) Node added in v1.1.0

func (mmNode *ClientMock) Node(c1 Ctx, s1 string, n1 NodeQuery) (n2 NodeInfo, err error)

Node implements Client

func (*ClientMock) NodeAfterCounter added in v1.1.0

func (mmNode *ClientMock) NodeAfterCounter() uint64

NodeAfterCounter returns a count of finished ClientMock.Node invocations

func (*ClientMock) NodeBeforeCounter added in v1.1.0

func (mmNode *ClientMock) NodeBeforeCounter() uint64

NodeBeforeCounter returns a count of ClientMock.Node invocations

func (*ClientMock) Nodes added in v1.1.0

func (mmNodes *ClientMock) Nodes(c1 Ctx, n1 NodesQuery) (na1 []Node, err error)

Nodes implements Client

func (*ClientMock) NodesAfterCounter added in v1.1.0

func (mmNodes *ClientMock) NodesAfterCounter() uint64

NodesAfterCounter returns a count of finished ClientMock.Nodes invocations

func (*ClientMock) NodesBeforeCounter added in v1.1.0

func (mmNodes *ClientMock) NodesBeforeCounter() uint64

NodesBeforeCounter returns a count of ClientMock.Nodes invocations

func (*ClientMock) Participate added in v1.1.0

func (mmParticipate *ClientMock) Participate(c1 Ctx, l1 LeadershipConfig, a1 AsLeaderFunc) (l2 LeaderSession, err error)

Participate implements Client

func (*ClientMock) ParticipateAfterCounter added in v1.1.0

func (mmParticipate *ClientMock) ParticipateAfterCounter() uint64

ParticipateAfterCounter returns a count of finished ClientMock.Participate invocations

func (*ClientMock) ParticipateBeforeCounter added in v1.1.0

func (mmParticipate *ClientMock) ParticipateBeforeCounter() uint64

ParticipateBeforeCounter returns a count of ClientMock.Participate invocations

func (*ClientMock) Put added in v1.1.0

func (mmPut *ClientMock) Put(c1 Ctx, s1 string, s2 string, q1 Query) (err error)

Put implements Client

func (*ClientMock) PutAfterCounter added in v1.1.0

func (mmPut *ClientMock) PutAfterCounter() uint64

PutAfterCounter returns a count of finished ClientMock.Put invocations

func (*ClientMock) PutBeforeCounter added in v1.1.0

func (mmPut *ClientMock) PutBeforeCounter() uint64

PutBeforeCounter returns a count of ClientMock.Put invocations

func (*ClientMock) ReadSession added in v1.1.0

func (mmReadSession *ClientMock) ReadSession(c1 Ctx, s1 SessionQuery) (s2 SessionConfig, err error)

ReadSession implements Client

func (*ClientMock) ReadSessionAfterCounter added in v1.1.0

func (mmReadSession *ClientMock) ReadSessionAfterCounter() uint64

ReadSessionAfterCounter returns a count of finished ClientMock.ReadSession invocations

func (*ClientMock) ReadSessionBeforeCounter added in v1.1.0

func (mmReadSession *ClientMock) ReadSessionBeforeCounter() uint64

ReadSessionBeforeCounter returns a count of ClientMock.ReadSession invocations

func (*ClientMock) Recurse added in v1.1.0

func (mmRecurse *ClientMock) Recurse(c1 Ctx, s1 string, q1 Query) (pa1 []Pair, err error)

Recurse implements Client

func (*ClientMock) RecurseAfterCounter added in v1.1.0

func (mmRecurse *ClientMock) RecurseAfterCounter() uint64

RecurseAfterCounter returns a count of finished ClientMock.Recurse invocations

func (*ClientMock) RecurseBeforeCounter added in v1.1.0

func (mmRecurse *ClientMock) RecurseBeforeCounter() uint64

RecurseBeforeCounter returns a count of ClientMock.Recurse invocations

func (*ClientMock) Reload added in v1.1.0

func (mmReload *ClientMock) Reload(ctx Ctx) (err error)

Reload implements Client

func (*ClientMock) ReloadAfterCounter added in v1.1.0

func (mmReload *ClientMock) ReloadAfterCounter() uint64

ReloadAfterCounter returns a count of finished ClientMock.Reload invocations

func (*ClientMock) ReloadBeforeCounter added in v1.1.0

func (mmReload *ClientMock) ReloadBeforeCounter() uint64

ReloadBeforeCounter returns a count of ClientMock.Reload invocations

func (*ClientMock) RenewSession added in v1.1.0

func (mmRenewSession *ClientMock) RenewSession(c1 Ctx, s1 SessionQuery) (d1 time.Duration, err error)

RenewSession implements Client

func (*ClientMock) RenewSessionAfterCounter added in v1.1.0

func (mmRenewSession *ClientMock) RenewSessionAfterCounter() uint64

RenewSessionAfterCounter returns a count of finished ClientMock.RenewSession invocations

func (*ClientMock) RenewSessionBeforeCounter added in v1.1.0

func (mmRenewSession *ClientMock) RenewSessionBeforeCounter() uint64

RenewSessionBeforeCounter returns a count of ClientMock.RenewSession invocations

func (*ClientMock) Self added in v1.1.0

func (mmSelf *ClientMock) Self(ctx Ctx) (a1 AgentInfo, err error)

Self implements Client

func (*ClientMock) SelfAfterCounter added in v1.1.0

func (mmSelf *ClientMock) SelfAfterCounter() uint64

SelfAfterCounter returns a count of finished ClientMock.Self invocations

func (*ClientMock) SelfBeforeCounter added in v1.1.0

func (mmSelf *ClientMock) SelfBeforeCounter() uint64

SelfBeforeCounter returns a count of ClientMock.Self invocations

func (*ClientMock) Service added in v1.1.0

func (mmService *ClientMock) Service(c1 Ctx, s1 string, s2 ServiceQuery) (ia1 []Instance, err error)

Service implements Client

func (*ClientMock) ServiceAfterCounter added in v1.1.0

func (mmService *ClientMock) ServiceAfterCounter() uint64

ServiceAfterCounter returns a count of finished ClientMock.Service invocations

func (*ClientMock) ServiceBeforeCounter added in v1.1.0

func (mmService *ClientMock) ServiceBeforeCounter() uint64

ServiceBeforeCounter returns a count of ClientMock.Service invocations

func (*ClientMock) Services added in v1.1.0

func (mmServices *ClientMock) Services(c1 Ctx, s1 ServicesQuery) (m1 map[string][]string, err error)

Services implements Client

func (*ClientMock) ServicesAfterCounter added in v1.1.0

func (mmServices *ClientMock) ServicesAfterCounter() uint64

ServicesAfterCounter returns a count of finished ClientMock.Services invocations

func (*ClientMock) ServicesBeforeCounter added in v1.1.0

func (mmServices *ClientMock) ServicesBeforeCounter() uint64

ServicesBeforeCounter returns a count of ClientMock.Services invocations

func (*ClientMock) SetACLToken added in v1.1.0

func (mmSetACLToken *ClientMock) SetACLToken(ctx Ctx, kind string, token string) (err error)

SetACLToken implements Client

func (*ClientMock) SetACLTokenAfterCounter added in v1.1.0

func (mmSetACLToken *ClientMock) SetACLTokenAfterCounter() uint64

SetACLTokenAfterCounter returns a count of finished ClientMock.SetACLToken invocations

func (*ClientMock) SetACLTokenBeforeCounter added in v1.1.0

func (mmSetACLToken *ClientMock) SetACLTokenBeforeCounter() uint64

SetACLTokenBeforeCounter returns a count of ClientMock.SetACLToken invocations

type ClientMockConnectExpectation added in v1.1.0

type ClientMockConnectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockConnectExpectation specifies expectation struct of the Client.Connect

func (*ClientMockConnectExpectation) Then added in v1.1.0

Then sets up Client.Connect return parameters for the expectation previously defined by the When method

type ClientMockConnectParams added in v1.1.0

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

ClientMockConnectParams contains parameters of the Client.Connect

type ClientMockConnectResults added in v1.1.0

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

ClientMockConnectResults contains results of the Client.Connect

type ClientMockCreateSessionExpectation added in v1.1.0

type ClientMockCreateSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockCreateSessionExpectation specifies expectation struct of the Client.CreateSession

func (*ClientMockCreateSessionExpectation) Then added in v1.1.0

Then sets up Client.CreateSession return parameters for the expectation previously defined by the When method

type ClientMockCreateSessionParams added in v1.1.0

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

ClientMockCreateSessionParams contains parameters of the Client.CreateSession

type ClientMockCreateSessionResults added in v1.1.0

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

ClientMockCreateSessionResults contains results of the Client.CreateSession

type ClientMockDataCentersExpectation added in v1.1.0

type ClientMockDataCentersExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockDataCentersExpectation specifies expectation struct of the Client.DataCenters

func (*ClientMockDataCentersExpectation) Then added in v1.1.0

Then sets up Client.DataCenters return parameters for the expectation previously defined by the When method

type ClientMockDataCentersParams added in v1.1.0

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

ClientMockDataCentersParams contains parameters of the Client.DataCenters

type ClientMockDataCentersResults added in v1.1.0

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

ClientMockDataCentersResults contains results of the Client.DataCenters

type ClientMockDeleteExpectation added in v1.1.0

type ClientMockDeleteExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockDeleteExpectation specifies expectation struct of the Client.Delete

func (*ClientMockDeleteExpectation) Then added in v1.1.0

Then sets up Client.Delete return parameters for the expectation previously defined by the When method

type ClientMockDeleteParams added in v1.1.0

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

ClientMockDeleteParams contains parameters of the Client.Delete

type ClientMockDeleteResults added in v1.1.0

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

ClientMockDeleteResults contains results of the Client.Delete

type ClientMockDeleteSessionExpectation added in v1.1.0

type ClientMockDeleteSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockDeleteSessionExpectation specifies expectation struct of the Client.DeleteSession

func (*ClientMockDeleteSessionExpectation) Then added in v1.1.0

Then sets up Client.DeleteSession return parameters for the expectation previously defined by the When method

type ClientMockDeleteSessionParams added in v1.1.0

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

ClientMockDeleteSessionParams contains parameters of the Client.DeleteSession

type ClientMockDeleteSessionResults added in v1.1.0

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

ClientMockDeleteSessionResults contains results of the Client.DeleteSession

type ClientMockForceLeaveExpectation added in v1.1.0

type ClientMockForceLeaveExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockForceLeaveExpectation specifies expectation struct of the Client.ForceLeave

func (*ClientMockForceLeaveExpectation) Then added in v1.1.0

Then sets up Client.ForceLeave return parameters for the expectation previously defined by the When method

type ClientMockForceLeaveParams added in v1.1.0

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

ClientMockForceLeaveParams contains parameters of the Client.ForceLeave

type ClientMockForceLeaveResults added in v1.1.0

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

ClientMockForceLeaveResults contains results of the Client.ForceLeave

type ClientMockGetExpectation added in v1.1.0

type ClientMockGetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockGetExpectation specifies expectation struct of the Client.Get

func (*ClientMockGetExpectation) Then added in v1.1.0

func (e *ClientMockGetExpectation) Then(s2 string, err error) *ClientMock

Then sets up Client.Get return parameters for the expectation previously defined by the When method

type ClientMockGetParams added in v1.1.0

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

ClientMockGetParams contains parameters of the Client.Get

type ClientMockGetResults added in v1.1.0

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

ClientMockGetResults contains results of the Client.Get

type ClientMockJoinExpectation added in v1.1.0

type ClientMockJoinExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockJoinExpectation specifies expectation struct of the Client.Join

func (*ClientMockJoinExpectation) Then added in v1.1.0

Then sets up Client.Join return parameters for the expectation previously defined by the When method

type ClientMockJoinParams added in v1.1.0

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

ClientMockJoinParams contains parameters of the Client.Join

type ClientMockJoinResults added in v1.1.0

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

ClientMockJoinResults contains results of the Client.Join

type ClientMockKeysExpectation added in v1.1.0

type ClientMockKeysExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockKeysExpectation specifies expectation struct of the Client.Keys

func (*ClientMockKeysExpectation) Then added in v1.1.0

func (e *ClientMockKeysExpectation) Then(sa1 []string, err error) *ClientMock

Then sets up Client.Keys return parameters for the expectation previously defined by the When method

type ClientMockKeysParams added in v1.1.0

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

ClientMockKeysParams contains parameters of the Client.Keys

type ClientMockKeysResults added in v1.1.0

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

ClientMockKeysResults contains results of the Client.Keys

type ClientMockLeaveExpectation added in v1.1.0

type ClientMockLeaveExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockLeaveExpectation specifies expectation struct of the Client.Leave

func (*ClientMockLeaveExpectation) Then added in v1.1.0

Then sets up Client.Leave return parameters for the expectation previously defined by the When method

type ClientMockLeaveParams added in v1.1.0

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

ClientMockLeaveParams contains parameters of the Client.Leave

type ClientMockLeaveResults added in v1.1.0

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

ClientMockLeaveResults contains results of the Client.Leave

type ClientMockListSessionsExpectation added in v1.1.0

type ClientMockListSessionsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockListSessionsExpectation specifies expectation struct of the Client.ListSessions

func (*ClientMockListSessionsExpectation) Then added in v1.1.0

Then sets up Client.ListSessions return parameters for the expectation previously defined by the When method

type ClientMockListSessionsParams added in v1.1.0

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

ClientMockListSessionsParams contains parameters of the Client.ListSessions

type ClientMockListSessionsResults added in v1.1.0

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

ClientMockListSessionsResults contains results of the Client.ListSessions

type ClientMockMaintenanceModeExpectation added in v1.1.0

type ClientMockMaintenanceModeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockMaintenanceModeExpectation specifies expectation struct of the Client.MaintenanceMode

func (*ClientMockMaintenanceModeExpectation) Then added in v1.1.0

Then sets up Client.MaintenanceMode return parameters for the expectation previously defined by the When method

type ClientMockMaintenanceModeParams added in v1.1.0

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

ClientMockMaintenanceModeParams contains parameters of the Client.MaintenanceMode

type ClientMockMaintenanceModeResults added in v1.1.0

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

ClientMockMaintenanceModeResults contains results of the Client.MaintenanceMode

type ClientMockMembersExpectation added in v1.1.0

type ClientMockMembersExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockMembersExpectation specifies expectation struct of the Client.Members

func (*ClientMockMembersExpectation) Then added in v1.1.0

Then sets up Client.Members return parameters for the expectation previously defined by the When method

type ClientMockMembersParams added in v1.1.0

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

ClientMockMembersParams contains parameters of the Client.Members

type ClientMockMembersResults added in v1.1.0

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

ClientMockMembersResults contains results of the Client.Members

type ClientMockMetricsExpectation added in v1.1.0

type ClientMockMetricsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockMetricsExpectation specifies expectation struct of the Client.Metrics

func (*ClientMockMetricsExpectation) Then added in v1.1.0

Then sets up Client.Metrics return parameters for the expectation previously defined by the When method

type ClientMockMetricsParams added in v1.1.0

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

ClientMockMetricsParams contains parameters of the Client.Metrics

type ClientMockMetricsResults added in v1.1.0

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

ClientMockMetricsResults contains results of the Client.Metrics

type ClientMockNodeExpectation added in v1.1.0

type ClientMockNodeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockNodeExpectation specifies expectation struct of the Client.Node

func (*ClientMockNodeExpectation) Then added in v1.1.0

Then sets up Client.Node return parameters for the expectation previously defined by the When method

type ClientMockNodeParams added in v1.1.0

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

ClientMockNodeParams contains parameters of the Client.Node

type ClientMockNodeResults added in v1.1.0

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

ClientMockNodeResults contains results of the Client.Node

type ClientMockNodesExpectation added in v1.1.0

type ClientMockNodesExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockNodesExpectation specifies expectation struct of the Client.Nodes

func (*ClientMockNodesExpectation) Then added in v1.1.0

func (e *ClientMockNodesExpectation) Then(na1 []Node, err error) *ClientMock

Then sets up Client.Nodes return parameters for the expectation previously defined by the When method

type ClientMockNodesParams added in v1.1.0

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

ClientMockNodesParams contains parameters of the Client.Nodes

type ClientMockNodesResults added in v1.1.0

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

ClientMockNodesResults contains results of the Client.Nodes

type ClientMockParticipateExpectation added in v1.1.0

type ClientMockParticipateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockParticipateExpectation specifies expectation struct of the Client.Participate

func (*ClientMockParticipateExpectation) Then added in v1.1.0

Then sets up Client.Participate return parameters for the expectation previously defined by the When method

type ClientMockParticipateParams added in v1.1.0

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

ClientMockParticipateParams contains parameters of the Client.Participate

type ClientMockParticipateResults added in v1.1.0

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

ClientMockParticipateResults contains results of the Client.Participate

type ClientMockPutExpectation added in v1.1.0

type ClientMockPutExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockPutExpectation specifies expectation struct of the Client.Put

func (*ClientMockPutExpectation) Then added in v1.1.0

Then sets up Client.Put return parameters for the expectation previously defined by the When method

type ClientMockPutParams added in v1.1.0

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

ClientMockPutParams contains parameters of the Client.Put

type ClientMockPutResults added in v1.1.0

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

ClientMockPutResults contains results of the Client.Put

type ClientMockReadSessionExpectation added in v1.1.0

type ClientMockReadSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockReadSessionExpectation specifies expectation struct of the Client.ReadSession

func (*ClientMockReadSessionExpectation) Then added in v1.1.0

Then sets up Client.ReadSession return parameters for the expectation previously defined by the When method

type ClientMockReadSessionParams added in v1.1.0

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

ClientMockReadSessionParams contains parameters of the Client.ReadSession

type ClientMockReadSessionResults added in v1.1.0

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

ClientMockReadSessionResults contains results of the Client.ReadSession

type ClientMockRecurseExpectation added in v1.1.0

type ClientMockRecurseExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockRecurseExpectation specifies expectation struct of the Client.Recurse

func (*ClientMockRecurseExpectation) Then added in v1.1.0

func (e *ClientMockRecurseExpectation) Then(pa1 []Pair, err error) *ClientMock

Then sets up Client.Recurse return parameters for the expectation previously defined by the When method

type ClientMockRecurseParams added in v1.1.0

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

ClientMockRecurseParams contains parameters of the Client.Recurse

type ClientMockRecurseResults added in v1.1.0

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

ClientMockRecurseResults contains results of the Client.Recurse

type ClientMockReloadExpectation added in v1.1.0

type ClientMockReloadExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockReloadExpectation specifies expectation struct of the Client.Reload

func (*ClientMockReloadExpectation) Then added in v1.1.0

Then sets up Client.Reload return parameters for the expectation previously defined by the When method

type ClientMockReloadParams added in v1.1.0

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

ClientMockReloadParams contains parameters of the Client.Reload

type ClientMockReloadResults added in v1.1.0

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

ClientMockReloadResults contains results of the Client.Reload

type ClientMockRenewSessionExpectation added in v1.1.0

type ClientMockRenewSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockRenewSessionExpectation specifies expectation struct of the Client.RenewSession

func (*ClientMockRenewSessionExpectation) Then added in v1.1.0

Then sets up Client.RenewSession return parameters for the expectation previously defined by the When method

type ClientMockRenewSessionParams added in v1.1.0

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

ClientMockRenewSessionParams contains parameters of the Client.RenewSession

type ClientMockRenewSessionResults added in v1.1.0

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

ClientMockRenewSessionResults contains results of the Client.RenewSession

type ClientMockSelfExpectation added in v1.1.0

type ClientMockSelfExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockSelfExpectation specifies expectation struct of the Client.Self

func (*ClientMockSelfExpectation) Then added in v1.1.0

Then sets up Client.Self return parameters for the expectation previously defined by the When method

type ClientMockSelfParams added in v1.1.0

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

ClientMockSelfParams contains parameters of the Client.Self

type ClientMockSelfResults added in v1.1.0

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

ClientMockSelfResults contains results of the Client.Self

type ClientMockServiceExpectation added in v1.1.0

type ClientMockServiceExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockServiceExpectation specifies expectation struct of the Client.Service

func (*ClientMockServiceExpectation) Then added in v1.1.0

Then sets up Client.Service return parameters for the expectation previously defined by the When method

type ClientMockServiceParams added in v1.1.0

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

ClientMockServiceParams contains parameters of the Client.Service

type ClientMockServiceResults added in v1.1.0

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

ClientMockServiceResults contains results of the Client.Service

type ClientMockServicesExpectation added in v1.1.0

type ClientMockServicesExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockServicesExpectation specifies expectation struct of the Client.Services

func (*ClientMockServicesExpectation) Then added in v1.1.0

Then sets up Client.Services return parameters for the expectation previously defined by the When method

type ClientMockServicesParams added in v1.1.0

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

ClientMockServicesParams contains parameters of the Client.Services

type ClientMockServicesResults added in v1.1.0

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

ClientMockServicesResults contains results of the Client.Services

type ClientMockSetACLTokenExpectation added in v1.1.0

type ClientMockSetACLTokenExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockSetACLTokenExpectation specifies expectation struct of the Client.SetACLToken

func (*ClientMockSetACLTokenExpectation) Then added in v1.1.0

Then sets up Client.SetACLToken return parameters for the expectation previously defined by the When method

type ClientMockSetACLTokenParams added in v1.1.0

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

ClientMockSetACLTokenParams contains parameters of the Client.SetACLToken

type ClientMockSetACLTokenResults added in v1.1.0

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

ClientMockSetACLTokenResults contains results of the Client.SetACLToken

type ClientOptions

type ClientOptions struct {
	// Address (optional) of the consul agent to communicate with. This value
	// will default to http://localhost:8500 if left unset. This is likely
	// the desired value, as consul is designed to run with an agent on
	// every node.
	Address string

	// Token (optional) will be used to authenticate requests to consul.
	Token string

	// HTTPClient (optional) is the underlying HTTP client to use for making
	// requests to consul agents and servers. If not set, a default HTTP client
	// is used with a default timeout of 10 seconds, and will keep connections
	// open.
	HTTPClient *http.Client

	// Logger may be optionally configured as an output for trace level logging
	// produced internally by the Client. This can be helpful for debugging logic
	// errors in client code.
	Logger loggy.Logger
}

ClientOptions are used to configure options of a client upon creation.

type Counter added in v1.1.0

type Counter struct {
	Name   string            `json:"Name"`
	Count  int               `json:"Count"`
	Rate   float64           `json:"Rate"`
	Sum    int               `json:"Sum"`
	Min    int               `json:"Min"`
	Max    int               `json:"Max"`
	Mean   float64           `json:"Mean"`
	Stddev float64           `json:"Stddev"`
	Labels map[string]string `json:"Labels"`
}

type Ctx added in v1.1.0

type Ctx = context.Context

Ctx is an alias for context.Context

type Gauge added in v1.1.0

type Gauge struct {
	Name   string            `json:"Name"`
	Value  int               `json:"Value"`
	Labels map[string]string `json:"Labels"`
}

type Instance added in v1.1.0

type Instance struct {
	ID                       string             `json:"ID"`
	Node                     string             `json:"Node"`
	Address                  string             `json:"Address"`
	Datacenter               string             `json:"Datacenter"`
	TaggedAddresses          map[string]string  `json:"TaggedAddresses"`
	NodeMeta                 map[string]string  `json:"NodeMeta"`
	ServiceAddress           string             `json:"ServiceAddress"`
	ServiceEnableTagOverride bool               `json:"ServiceEnableTagOverride"`
	ServiceID                string             `json:"ServiceID"`
	ServiceName              string             `json:"ServiceName"`
	ServicePort              int                `json:"ServicePort"`
	ServiceMeta              map[string]string  `json:"ServiceMeta"`
	ServiceTaggedAddresses   map[string]Address `json:"ServiceTaggedAddresses"`
	ServiceTags              []string           `json:"ServiceTags"`
	ServiceProxyDestination  string             `json:"ServiceProxyDestination"`
	ServiceProxy             Proxy              `json:"ServiceProxy"`
	ServiceConnect           ServiceConnect     `json:"ServiceConnect"`
}

type KV

type KV interface {

	// Get will return the value defined at path, for dc.
	Get(Ctx, string, Query) (string, error)

	// Put will set value at path, in dc.
	Put(Ctx, string, string, Query) error

	// Delete will remove the value at path, in dc.
	Delete(Ctx, string, Query) error

	// Keys will list all subpaths in asciibetical order.
	// The returned paths may be terminal (ie, the value is
	// stored content) or they may be further traversable like
	// a directory listing, in dc.
	Keys(Ctx, string, Query) ([]string, error)

	// Recurse will recursively descend through path, collecting
	// all KV pairs along the way, in dc.
	Recurse(Ctx, string, Query) ([]Pair, error)
}

A KV can access the key-value store of consul.

The consul KV store is useful for storing small values of information. It is intended to be used to store things like service configuration and other meta-data. The maximum size of a value is 512KiB.

Each DC contains its own KV store. The data in a KV store is not replicated across DCs.

https://www.consul.io/api/kv.html

type KVMock added in v1.1.0

type KVMock struct {
	DeleteMock mKVMockDelete

	GetMock mKVMockGet

	KeysMock mKVMockKeys

	PutMock mKVMockPut

	RecurseMock mKVMockRecurse
	// contains filtered or unexported fields
}

KVMock implements KV

func NewKVMock added in v1.1.0

func NewKVMock(t minimock.Tester) *KVMock

NewKVMock returns a mock for KV

func (*KVMock) Delete added in v1.1.0

func (mmDelete *KVMock) Delete(c1 Ctx, s1 string, q1 Query) (err error)

Delete implements KV

func (*KVMock) DeleteAfterCounter added in v1.1.0

func (mmDelete *KVMock) DeleteAfterCounter() uint64

DeleteAfterCounter returns a count of finished KVMock.Delete invocations

func (*KVMock) DeleteBeforeCounter added in v1.1.0

func (mmDelete *KVMock) DeleteBeforeCounter() uint64

DeleteBeforeCounter returns a count of KVMock.Delete invocations

func (*KVMock) Get added in v1.1.0

func (mmGet *KVMock) Get(c1 Ctx, s1 string, q1 Query) (s2 string, err error)

Get implements KV

func (*KVMock) GetAfterCounter added in v1.1.0

func (mmGet *KVMock) GetAfterCounter() uint64

GetAfterCounter returns a count of finished KVMock.Get invocations

func (*KVMock) GetBeforeCounter added in v1.1.0

func (mmGet *KVMock) GetBeforeCounter() uint64

GetBeforeCounter returns a count of KVMock.Get invocations

func (*KVMock) Keys added in v1.1.0

func (mmKeys *KVMock) Keys(c1 Ctx, s1 string, q1 Query) (sa1 []string, err error)

Keys implements KV

func (*KVMock) KeysAfterCounter added in v1.1.0

func (mmKeys *KVMock) KeysAfterCounter() uint64

KeysAfterCounter returns a count of finished KVMock.Keys invocations

func (*KVMock) KeysBeforeCounter added in v1.1.0

func (mmKeys *KVMock) KeysBeforeCounter() uint64

KeysBeforeCounter returns a count of KVMock.Keys invocations

func (*KVMock) MinimockDeleteDone added in v1.1.0

func (m *KVMock) MinimockDeleteDone() bool

MinimockDeleteDone returns true if the count of the Delete invocations corresponds the number of defined expectations

func (*KVMock) MinimockDeleteInspect added in v1.1.0

func (m *KVMock) MinimockDeleteInspect()

MinimockDeleteInspect logs each unmet expectation

func (*KVMock) MinimockFinish added in v1.1.0

func (m *KVMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*KVMock) MinimockGetDone added in v1.1.0

func (m *KVMock) MinimockGetDone() bool

MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations

func (*KVMock) MinimockGetInspect added in v1.1.0

func (m *KVMock) MinimockGetInspect()

MinimockGetInspect logs each unmet expectation

func (*KVMock) MinimockKeysDone added in v1.1.0

func (m *KVMock) MinimockKeysDone() bool

MinimockKeysDone returns true if the count of the Keys invocations corresponds the number of defined expectations

func (*KVMock) MinimockKeysInspect added in v1.1.0

func (m *KVMock) MinimockKeysInspect()

MinimockKeysInspect logs each unmet expectation

func (*KVMock) MinimockPutDone added in v1.1.0

func (m *KVMock) MinimockPutDone() bool

MinimockPutDone returns true if the count of the Put invocations corresponds the number of defined expectations

func (*KVMock) MinimockPutInspect added in v1.1.0

func (m *KVMock) MinimockPutInspect()

MinimockPutInspect logs each unmet expectation

func (*KVMock) MinimockRecurseDone added in v1.1.0

func (m *KVMock) MinimockRecurseDone() bool

MinimockRecurseDone returns true if the count of the Recurse invocations corresponds the number of defined expectations

func (*KVMock) MinimockRecurseInspect added in v1.1.0

func (m *KVMock) MinimockRecurseInspect()

MinimockRecurseInspect logs each unmet expectation

func (*KVMock) MinimockWait added in v1.1.0

func (m *KVMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*KVMock) Put added in v1.1.0

func (mmPut *KVMock) Put(c1 Ctx, s1 string, s2 string, q1 Query) (err error)

Put implements KV

func (*KVMock) PutAfterCounter added in v1.1.0

func (mmPut *KVMock) PutAfterCounter() uint64

PutAfterCounter returns a count of finished KVMock.Put invocations

func (*KVMock) PutBeforeCounter added in v1.1.0

func (mmPut *KVMock) PutBeforeCounter() uint64

PutBeforeCounter returns a count of KVMock.Put invocations

func (*KVMock) Recurse added in v1.1.0

func (mmRecurse *KVMock) Recurse(c1 Ctx, s1 string, q1 Query) (pa1 []Pair, err error)

Recurse implements KV

func (*KVMock) RecurseAfterCounter added in v1.1.0

func (mmRecurse *KVMock) RecurseAfterCounter() uint64

RecurseAfterCounter returns a count of finished KVMock.Recurse invocations

func (*KVMock) RecurseBeforeCounter added in v1.1.0

func (mmRecurse *KVMock) RecurseBeforeCounter() uint64

RecurseBeforeCounter returns a count of KVMock.Recurse invocations

type KVMockDeleteExpectation added in v1.1.0

type KVMockDeleteExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

KVMockDeleteExpectation specifies expectation struct of the KV.Delete

func (*KVMockDeleteExpectation) Then added in v1.1.0

func (e *KVMockDeleteExpectation) Then(err error) *KVMock

Then sets up KV.Delete return parameters for the expectation previously defined by the When method

type KVMockDeleteParams added in v1.1.0

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

KVMockDeleteParams contains parameters of the KV.Delete

type KVMockDeleteResults added in v1.1.0

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

KVMockDeleteResults contains results of the KV.Delete

type KVMockGetExpectation added in v1.1.0

type KVMockGetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

KVMockGetExpectation specifies expectation struct of the KV.Get

func (*KVMockGetExpectation) Then added in v1.1.0

func (e *KVMockGetExpectation) Then(s2 string, err error) *KVMock

Then sets up KV.Get return parameters for the expectation previously defined by the When method

type KVMockGetParams added in v1.1.0

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

KVMockGetParams contains parameters of the KV.Get

type KVMockGetResults added in v1.1.0

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

KVMockGetResults contains results of the KV.Get

type KVMockKeysExpectation added in v1.1.0

type KVMockKeysExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

KVMockKeysExpectation specifies expectation struct of the KV.Keys

func (*KVMockKeysExpectation) Then added in v1.1.0

func (e *KVMockKeysExpectation) Then(sa1 []string, err error) *KVMock

Then sets up KV.Keys return parameters for the expectation previously defined by the When method

type KVMockKeysParams added in v1.1.0

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

KVMockKeysParams contains parameters of the KV.Keys

type KVMockKeysResults added in v1.1.0

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

KVMockKeysResults contains results of the KV.Keys

type KVMockPutExpectation added in v1.1.0

type KVMockPutExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

KVMockPutExpectation specifies expectation struct of the KV.Put

func (*KVMockPutExpectation) Then added in v1.1.0

func (e *KVMockPutExpectation) Then(err error) *KVMock

Then sets up KV.Put return parameters for the expectation previously defined by the When method

type KVMockPutParams added in v1.1.0

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

KVMockPutParams contains parameters of the KV.Put

type KVMockPutResults added in v1.1.0

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

KVMockPutResults contains results of the KV.Put

type KVMockRecurseExpectation added in v1.1.0

type KVMockRecurseExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

KVMockRecurseExpectation specifies expectation struct of the KV.Recurse

func (*KVMockRecurseExpectation) Then added in v1.1.0

func (e *KVMockRecurseExpectation) Then(pa1 []Pair, err error) *KVMock

Then sets up KV.Recurse return parameters for the expectation previously defined by the When method

type KVMockRecurseParams added in v1.1.0

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

KVMockRecurseParams contains parameters of the KV.Recurse

type KVMockRecurseResults added in v1.1.0

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

KVMockRecurseResults contains results of the KV.Recurse

type LeaderSession

type LeaderSession interface {
	Abdicate(Ctx) error
	Current(Ctx) (string, error)
	SessionID(Ctx) string
}

A LeaderSession is used to inspect and manage the underlying consul session being used to participate in leadership elections.

type LeaderSessionMock added in v1.1.0

type LeaderSessionMock struct {
	AbdicateMock mLeaderSessionMockAbdicate

	CurrentMock mLeaderSessionMockCurrent

	SessionIDMock mLeaderSessionMockSessionID
	// contains filtered or unexported fields
}

LeaderSessionMock implements LeaderSession

func NewLeaderSessionMock added in v1.1.0

func NewLeaderSessionMock(t minimock.Tester) *LeaderSessionMock

NewLeaderSessionMock returns a mock for LeaderSession

func (*LeaderSessionMock) Abdicate added in v1.1.0

func (mmAbdicate *LeaderSessionMock) Abdicate(c1 Ctx) (err error)

Abdicate implements LeaderSession

func (*LeaderSessionMock) AbdicateAfterCounter added in v1.1.0

func (mmAbdicate *LeaderSessionMock) AbdicateAfterCounter() uint64

AbdicateAfterCounter returns a count of finished LeaderSessionMock.Abdicate invocations

func (*LeaderSessionMock) AbdicateBeforeCounter added in v1.1.0

func (mmAbdicate *LeaderSessionMock) AbdicateBeforeCounter() uint64

AbdicateBeforeCounter returns a count of LeaderSessionMock.Abdicate invocations

func (*LeaderSessionMock) Current added in v1.1.0

func (mmCurrent *LeaderSessionMock) Current(c1 Ctx) (s1 string, err error)

Current implements LeaderSession

func (*LeaderSessionMock) CurrentAfterCounter added in v1.1.0

func (mmCurrent *LeaderSessionMock) CurrentAfterCounter() uint64

CurrentAfterCounter returns a count of finished LeaderSessionMock.Current invocations

func (*LeaderSessionMock) CurrentBeforeCounter added in v1.1.0

func (mmCurrent *LeaderSessionMock) CurrentBeforeCounter() uint64

CurrentBeforeCounter returns a count of LeaderSessionMock.Current invocations

func (*LeaderSessionMock) MinimockAbdicateDone added in v1.1.0

func (m *LeaderSessionMock) MinimockAbdicateDone() bool

MinimockAbdicateDone returns true if the count of the Abdicate invocations corresponds the number of defined expectations

func (*LeaderSessionMock) MinimockAbdicateInspect added in v1.1.0

func (m *LeaderSessionMock) MinimockAbdicateInspect()

MinimockAbdicateInspect logs each unmet expectation

func (*LeaderSessionMock) MinimockCurrentDone added in v1.1.0

func (m *LeaderSessionMock) MinimockCurrentDone() bool

MinimockCurrentDone returns true if the count of the Current invocations corresponds the number of defined expectations

func (*LeaderSessionMock) MinimockCurrentInspect added in v1.1.0

func (m *LeaderSessionMock) MinimockCurrentInspect()

MinimockCurrentInspect logs each unmet expectation

func (*LeaderSessionMock) MinimockFinish added in v1.1.0

func (m *LeaderSessionMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*LeaderSessionMock) MinimockSessionIDDone added in v1.1.0

func (m *LeaderSessionMock) MinimockSessionIDDone() bool

MinimockSessionIDDone returns true if the count of the SessionID invocations corresponds the number of defined expectations

func (*LeaderSessionMock) MinimockSessionIDInspect added in v1.1.0

func (m *LeaderSessionMock) MinimockSessionIDInspect()

MinimockSessionIDInspect logs each unmet expectation

func (*LeaderSessionMock) MinimockWait added in v1.1.0

func (m *LeaderSessionMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*LeaderSessionMock) SessionID added in v1.1.0

func (mmSessionID *LeaderSessionMock) SessionID(c1 Ctx) (s1 string)

SessionID implements LeaderSession

func (*LeaderSessionMock) SessionIDAfterCounter added in v1.1.0

func (mmSessionID *LeaderSessionMock) SessionIDAfterCounter() uint64

SessionIDAfterCounter returns a count of finished LeaderSessionMock.SessionID invocations

func (*LeaderSessionMock) SessionIDBeforeCounter added in v1.1.0

func (mmSessionID *LeaderSessionMock) SessionIDBeforeCounter() uint64

SessionIDBeforeCounter returns a count of LeaderSessionMock.SessionID invocations

type LeaderSessionMockAbdicateExpectation added in v1.1.0

type LeaderSessionMockAbdicateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

LeaderSessionMockAbdicateExpectation specifies expectation struct of the LeaderSession.Abdicate

func (*LeaderSessionMockAbdicateExpectation) Then added in v1.1.0

Then sets up LeaderSession.Abdicate return parameters for the expectation previously defined by the When method

type LeaderSessionMockAbdicateParams added in v1.1.0

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

LeaderSessionMockAbdicateParams contains parameters of the LeaderSession.Abdicate

type LeaderSessionMockAbdicateResults added in v1.1.0

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

LeaderSessionMockAbdicateResults contains results of the LeaderSession.Abdicate

type LeaderSessionMockCurrentExpectation added in v1.1.0

type LeaderSessionMockCurrentExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

LeaderSessionMockCurrentExpectation specifies expectation struct of the LeaderSession.Current

func (*LeaderSessionMockCurrentExpectation) Then added in v1.1.0

Then sets up LeaderSession.Current return parameters for the expectation previously defined by the When method

type LeaderSessionMockCurrentParams added in v1.1.0

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

LeaderSessionMockCurrentParams contains parameters of the LeaderSession.Current

type LeaderSessionMockCurrentResults added in v1.1.0

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

LeaderSessionMockCurrentResults contains results of the LeaderSession.Current

type LeaderSessionMockSessionIDExpectation added in v1.1.0

type LeaderSessionMockSessionIDExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

LeaderSessionMockSessionIDExpectation specifies expectation struct of the LeaderSession.SessionID

func (*LeaderSessionMockSessionIDExpectation) Then added in v1.1.0

Then sets up LeaderSession.SessionID return parameters for the expectation previously defined by the When method

type LeaderSessionMockSessionIDParams added in v1.1.0

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

LeaderSessionMockSessionIDParams contains parameters of the LeaderSession.SessionID

type LeaderSessionMockSessionIDResults added in v1.1.0

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

LeaderSessionMockSessionIDResults contains results of the LeaderSession.SessionID

type LeadershipConfig

type LeadershipConfig struct {
	// Key is the path used to store session information in
	// the consul KV store. This must be set for the client to be used for
	// leader election. Typically this value will look something like
	// "service/<service name>/leader".
	Key string

	// ContactInfo is an opaque string that identifies the leader elected node.
	// This is what clients should use to know how to connect to the service
	// that is currently the leader. How this string is created, parsed, and
	// interpreted is an implementation detail left to the clients. Typically,
	// this string will in the form of a URI.
	ContactInfo string

	// Description is an arbitrary human-readable name for this leader election.
	// If not set, Description defaults to "default-leader-session".
	Description string

	// See SessionConfig.LockDelay.
	LockDelay time.Duration

	// See SessionConfig.TTL.
	TTL time.Duration
}

type Metrics added in v1.1.0

type Metrics struct {
	Timestamp string    `json:"Timestamp"`
	Gauges    []Gauge   `json:"Gauges"`
	Counters  []Counter `json:"Counters"`
	Samples   []Sample  `json:"Samples"`
}

Metrics contains information about the agent from the /v1/agent/metrics endpoint.

type Node

type Node struct {
	Name            string            `json:"Node"`
	Address         string            `json:"Address"`
	TaggedAddresses map[string]string `json:"TaggedAddresses"`
}

A Node represents a host on which a consul agent is running.

type NodeInfo

type NodeInfo struct {
	Node     Node `json:"Node"`
	Services map[string]struct {
		ID      string   `json:"ID"`
		Service string   `json:"Service"`
		Tags    []string `json:"Tags"`
		Port    int      `json:"Port"`
	} `json:"Services"`
}

A NodeInfo contains detailed information about a node, including all of the services defined to exist on that node.

type NodeQuery added in v1.1.0

type NodeQuery struct {
	// DC indicates the datacenter to query.
	//
	// If blank, this will default to the datacenter that the queried agent is in.
	DC string

	// Filter specifies an advanced filtering expression.
	//
	// https://www.consul.io/api/features/filtering.html
	Filter string
}

A NodeQuery is used to define values for each of the optional parameters to the catalog node endpoint.

type NodesQuery added in v1.1.0

type NodesQuery struct {
	// DC indicates the datacenter to query.
	//
	// If blank, this will default to the datacenter that the queried agent is in.
	DC string

	// Near specifies which node should be treated as the "center" in terms of
	// round-trip time for ordering the returned nodes. Nodes at the beginning
	// of the list will have the shortest round-trip times to the given node.
	//
	// The value "_agent" will cause the agent's node to be used for the sort.
	//
	// If blank, no default behavior is defined.
	Near string

	// NodeMeta creates a filter based on node metadata, using the given list
	// of key:value pairs.
	//
	// If blank, no node metadata filter is applied.
	NodeMeta []Pair

	// Filter specifies an advanced filtering expression.
	//
	// https://www.consul.io/api/features/filtering.html
	Filter string
}

NodesQuery is used to define values for each of the optional parameters to the catalog nodes endpoint.

https://www.consul.io/api/catalog.html#parameters-2

type Pair added in v1.1.0

type Pair struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

func (Pair) String added in v1.1.0

func (p Pair) String() string

type Proxy added in v1.1.0

type Proxy struct {
	DestinationServiceName string `json:"DestinationServiceName"`
	DestinationServiceID   string `json:"DestinationServiceID"`
	LocalServiceAddress    string `json:"LocalServiceAddress"`
	LocalServicePort       int    `json:"LocalServicePort"`
}

type Query added in v1.1.0

type Query struct {
	DC string
}

type RequestError

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

RequestError exposes the status code of a http request error

func (*RequestError) Error

func (h *RequestError) Error() string

func (*RequestError) StatusCode

func (h *RequestError) StatusCode() int

type Sample added in v1.1.0

type Sample struct {
	Name   string            `json:"Name"`
	Count  int               `json:"Count"`
	Rate   float64           `json:"Rate"`
	Sum    float64           `json:"Sum"`
	Min    float64           `json:"Min"`
	Max    float64           `json:"Max"`
	Mean   float64           `json:"Mean"`
	Stddev float64           `json:"Stddev"`
	Labels map[string]string `json:"Labels"`
}

type ServiceConnect added in v1.1.0

type ServiceConnect struct {
	Native bool `json:"Native"`
}

type ServiceQuery added in v1.1.0

type ServiceQuery struct {
	// DC indicates the datacenter to query.
	//
	// If blank, this will default to the datacenter that the queried agent is in.
	DC string

	// Tags specifies a list of tags to filter on. Only instances matching all
	// given tags will be returned.
	Tags []string

	// Near specifies which node should be treated as the "center" in terms of
	// round-trip time for ordering the returned nodes. Nodes at the beginning
	// of the list will have the shortest round-trip times to the given node.
	//
	// The value "_agent" will cause the agent's node to be used for the sort.
	//
	// If blank, no default behavior is defined.
	Near string

	// NodeMeta creates a filter based on node metadata, using the given list
	// of key:value pairs.
	//
	// If blank, no node metadata filter is applied.
	NodeMeta []Pair

	// Filter specifies an advanced filtering expression.
	//
	// https://www.consul.io/api/features/filtering.html
	Filter string
}

type ServicesQuery added in v1.1.0

type ServicesQuery struct {
	// DC indicates the datacenter to query.
	//
	// If blank, this will default to the datacenter that the queried agent is in.
	DC string

	// NodeMeta creates a filter based on node metadata, using the given list
	// of key:value pairs.
	//
	// If blank, no node metadata filter is applied.
	NodeMeta []Pair
}

type Session

type Session interface {
	// CreateSession will initialize a new session.
	//
	// https://www.consul.io/api/session.html#create-session
	CreateSession(Ctx, SessionConfig) (SessionID, error)

	// DeleteSession will delete session of id.
	//
	// https://www.consul.io/api/session.html#delete-session
	DeleteSession(Ctx, SessionQuery) error

	// ReadSession will return the session information for id.
	//
	// https://www.consul.io/api/session.html#read-session
	ReadSession(Ctx, SessionQuery) (SessionConfig, error)

	// ListSessions will list every session on node.
	//
	// https://www.consul.io/api/session.html#list-sessions-for-node
	ListSessions(ctx Ctx, dc, node string) (map[SessionID]SessionConfig, error)

	// RenewSession will renew session of id.
	//
	// https://www.consul.io/api/session.html#renew-session
	RenewSession(Ctx, SessionQuery) (time.Duration, error)
}

type SessionConfig

type SessionConfig struct {
	// The DC in which the node holding the session.
	DC string `json:"-"` // not part of the official API

	// The node with which the session is associated. Typically, this should be
	// set to the node name of the local consul agent. That information can be
	// retrieved using the Self endpoint.
	Node string `json:"Node"`

	// Name is a human-readable identifier for this session.
	Name string `json:"Name"`

	// LockDelay determines the minimum amount of time that must pass
	// after a lock expiration before a new lock acquisition may take place.
	// The use of such a delay is to allow the potentially still-alive leader
	// to detect its own lock invalidation and stop processing requests that
	// may lead to an inconsistent state. This mechanism is not "bullet-proof",
	// but it eliminates the need for clients to include their own timeout code.
	// A zero-value disables this feature.
	LockDelay time.Duration `json:"LockDelay"`

	// TTL represents the amount of time that may pass before the session
	// automatically becomes invalidated. Typically a lower value for TTL
	// is better, as a node that unexpectedly goes "off the grid" will
	// continue to own the lock until the TTL expires.
	TTL time.Duration `json:"TTL"`

	// Behavior controls what action to take when a session is invalidated.
	// - SessionRelease: causes any held locks to be released.
	// - SessionDelete: causes any held locks to be deleted.
	Behavior SessionTerminationBehavior `json:"Behavior"`
}

type SessionID

type SessionID string

type SessionMock added in v1.1.0

type SessionMock struct {
	CreateSessionMock mSessionMockCreateSession

	DeleteSessionMock mSessionMockDeleteSession

	ListSessionsMock mSessionMockListSessions

	ReadSessionMock mSessionMockReadSession

	RenewSessionMock mSessionMockRenewSession
	// contains filtered or unexported fields
}

SessionMock implements Session

func NewSessionMock added in v1.1.0

func NewSessionMock(t minimock.Tester) *SessionMock

NewSessionMock returns a mock for Session

func (*SessionMock) CreateSession added in v1.1.0

func (mmCreateSession *SessionMock) CreateSession(c1 Ctx, s1 SessionConfig) (s2 SessionID, err error)

CreateSession implements Session

func (*SessionMock) CreateSessionAfterCounter added in v1.1.0

func (mmCreateSession *SessionMock) CreateSessionAfterCounter() uint64

CreateSessionAfterCounter returns a count of finished SessionMock.CreateSession invocations

func (*SessionMock) CreateSessionBeforeCounter added in v1.1.0

func (mmCreateSession *SessionMock) CreateSessionBeforeCounter() uint64

CreateSessionBeforeCounter returns a count of SessionMock.CreateSession invocations

func (*SessionMock) DeleteSession added in v1.1.0

func (mmDeleteSession *SessionMock) DeleteSession(c1 Ctx, s1 SessionQuery) (err error)

DeleteSession implements Session

func (*SessionMock) DeleteSessionAfterCounter added in v1.1.0

func (mmDeleteSession *SessionMock) DeleteSessionAfterCounter() uint64

DeleteSessionAfterCounter returns a count of finished SessionMock.DeleteSession invocations

func (*SessionMock) DeleteSessionBeforeCounter added in v1.1.0

func (mmDeleteSession *SessionMock) DeleteSessionBeforeCounter() uint64

DeleteSessionBeforeCounter returns a count of SessionMock.DeleteSession invocations

func (*SessionMock) ListSessions added in v1.1.0

func (mmListSessions *SessionMock) ListSessions(ctx Ctx, dc string, node string) (m1 map[SessionID]SessionConfig, err error)

ListSessions implements Session

func (*SessionMock) ListSessionsAfterCounter added in v1.1.0

func (mmListSessions *SessionMock) ListSessionsAfterCounter() uint64

ListSessionsAfterCounter returns a count of finished SessionMock.ListSessions invocations

func (*SessionMock) ListSessionsBeforeCounter added in v1.1.0

func (mmListSessions *SessionMock) ListSessionsBeforeCounter() uint64

ListSessionsBeforeCounter returns a count of SessionMock.ListSessions invocations

func (*SessionMock) MinimockCreateSessionDone added in v1.1.0

func (m *SessionMock) MinimockCreateSessionDone() bool

MinimockCreateSessionDone returns true if the count of the CreateSession invocations corresponds the number of defined expectations

func (*SessionMock) MinimockCreateSessionInspect added in v1.1.0

func (m *SessionMock) MinimockCreateSessionInspect()

MinimockCreateSessionInspect logs each unmet expectation

func (*SessionMock) MinimockDeleteSessionDone added in v1.1.0

func (m *SessionMock) MinimockDeleteSessionDone() bool

MinimockDeleteSessionDone returns true if the count of the DeleteSession invocations corresponds the number of defined expectations

func (*SessionMock) MinimockDeleteSessionInspect added in v1.1.0

func (m *SessionMock) MinimockDeleteSessionInspect()

MinimockDeleteSessionInspect logs each unmet expectation

func (*SessionMock) MinimockFinish added in v1.1.0

func (m *SessionMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*SessionMock) MinimockListSessionsDone added in v1.1.0

func (m *SessionMock) MinimockListSessionsDone() bool

MinimockListSessionsDone returns true if the count of the ListSessions invocations corresponds the number of defined expectations

func (*SessionMock) MinimockListSessionsInspect added in v1.1.0

func (m *SessionMock) MinimockListSessionsInspect()

MinimockListSessionsInspect logs each unmet expectation

func (*SessionMock) MinimockReadSessionDone added in v1.1.0

func (m *SessionMock) MinimockReadSessionDone() bool

MinimockReadSessionDone returns true if the count of the ReadSession invocations corresponds the number of defined expectations

func (*SessionMock) MinimockReadSessionInspect added in v1.1.0

func (m *SessionMock) MinimockReadSessionInspect()

MinimockReadSessionInspect logs each unmet expectation

func (*SessionMock) MinimockRenewSessionDone added in v1.1.0

func (m *SessionMock) MinimockRenewSessionDone() bool

MinimockRenewSessionDone returns true if the count of the RenewSession invocations corresponds the number of defined expectations

func (*SessionMock) MinimockRenewSessionInspect added in v1.1.0

func (m *SessionMock) MinimockRenewSessionInspect()

MinimockRenewSessionInspect logs each unmet expectation

func (*SessionMock) MinimockWait added in v1.1.0

func (m *SessionMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*SessionMock) ReadSession added in v1.1.0

func (mmReadSession *SessionMock) ReadSession(c1 Ctx, s1 SessionQuery) (s2 SessionConfig, err error)

ReadSession implements Session

func (*SessionMock) ReadSessionAfterCounter added in v1.1.0

func (mmReadSession *SessionMock) ReadSessionAfterCounter() uint64

ReadSessionAfterCounter returns a count of finished SessionMock.ReadSession invocations

func (*SessionMock) ReadSessionBeforeCounter added in v1.1.0

func (mmReadSession *SessionMock) ReadSessionBeforeCounter() uint64

ReadSessionBeforeCounter returns a count of SessionMock.ReadSession invocations

func (*SessionMock) RenewSession added in v1.1.0

func (mmRenewSession *SessionMock) RenewSession(c1 Ctx, s1 SessionQuery) (d1 time.Duration, err error)

RenewSession implements Session

func (*SessionMock) RenewSessionAfterCounter added in v1.1.0

func (mmRenewSession *SessionMock) RenewSessionAfterCounter() uint64

RenewSessionAfterCounter returns a count of finished SessionMock.RenewSession invocations

func (*SessionMock) RenewSessionBeforeCounter added in v1.1.0

func (mmRenewSession *SessionMock) RenewSessionBeforeCounter() uint64

RenewSessionBeforeCounter returns a count of SessionMock.RenewSession invocations

type SessionMockCreateSessionExpectation added in v1.1.0

type SessionMockCreateSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SessionMockCreateSessionExpectation specifies expectation struct of the Session.CreateSession

func (*SessionMockCreateSessionExpectation) Then added in v1.1.0

Then sets up Session.CreateSession return parameters for the expectation previously defined by the When method

type SessionMockCreateSessionParams added in v1.1.0

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

SessionMockCreateSessionParams contains parameters of the Session.CreateSession

type SessionMockCreateSessionResults added in v1.1.0

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

SessionMockCreateSessionResults contains results of the Session.CreateSession

type SessionMockDeleteSessionExpectation added in v1.1.0

type SessionMockDeleteSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SessionMockDeleteSessionExpectation specifies expectation struct of the Session.DeleteSession

func (*SessionMockDeleteSessionExpectation) Then added in v1.1.0

Then sets up Session.DeleteSession return parameters for the expectation previously defined by the When method

type SessionMockDeleteSessionParams added in v1.1.0

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

SessionMockDeleteSessionParams contains parameters of the Session.DeleteSession

type SessionMockDeleteSessionResults added in v1.1.0

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

SessionMockDeleteSessionResults contains results of the Session.DeleteSession

type SessionMockListSessionsExpectation added in v1.1.0

type SessionMockListSessionsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SessionMockListSessionsExpectation specifies expectation struct of the Session.ListSessions

func (*SessionMockListSessionsExpectation) Then added in v1.1.0

Then sets up Session.ListSessions return parameters for the expectation previously defined by the When method

type SessionMockListSessionsParams added in v1.1.0

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

SessionMockListSessionsParams contains parameters of the Session.ListSessions

type SessionMockListSessionsResults added in v1.1.0

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

SessionMockListSessionsResults contains results of the Session.ListSessions

type SessionMockReadSessionExpectation added in v1.1.0

type SessionMockReadSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SessionMockReadSessionExpectation specifies expectation struct of the Session.ReadSession

func (*SessionMockReadSessionExpectation) Then added in v1.1.0

Then sets up Session.ReadSession return parameters for the expectation previously defined by the When method

type SessionMockReadSessionParams added in v1.1.0

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

SessionMockReadSessionParams contains parameters of the Session.ReadSession

type SessionMockReadSessionResults added in v1.1.0

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

SessionMockReadSessionResults contains results of the Session.ReadSession

type SessionMockRenewSessionExpectation added in v1.1.0

type SessionMockRenewSessionExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

SessionMockRenewSessionExpectation specifies expectation struct of the Session.RenewSession

func (*SessionMockRenewSessionExpectation) Then added in v1.1.0

Then sets up Session.RenewSession return parameters for the expectation previously defined by the When method

type SessionMockRenewSessionParams added in v1.1.0

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

SessionMockRenewSessionParams contains parameters of the Session.RenewSession

type SessionMockRenewSessionResults added in v1.1.0

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

SessionMockRenewSessionResults contains results of the Session.RenewSession

type SessionQuery added in v1.1.0

type SessionQuery struct {
	// ID of the session for which the query is regarding.
	ID SessionID

	// DC indicates which dc to query.
	//
	// If blank, this will default to the dc that the queried agent is in.
	DC string
}

SessionQuery is used to define values for each of the optional parameters on the session endpoint.

type SessionTerminationBehavior

type SessionTerminationBehavior string

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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