Documentation ¶
Index ¶
- func NewClient(config *capi.Config, consulAPITimeout time.Duration) (*capi.Client, error)
- func NewClientFromConnMgr(config *Config, watcher ServerConnectionManager) (*capi.Client, error)
- func NewClientFromConnMgrState(config *Config, state discovery.State) (*capi.Client, error)
- type Config
- type DynamicClient
- type MockServerConnectionManager
- type ServerConnectionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient returns a V1 Consul API client. It adds a required User-Agent header that describes the version of consul-k8s making the call.
func NewClientFromConnMgr ¶
func NewClientFromConnMgr(config *Config, watcher ServerConnectionManager) (*capi.Client, error)
NewClientFromConnMgr creates a new V1 API client by first getting the state of the passed watcher.
func NewClientFromConnMgrState ¶
todo (ishustava): replace all usages of this one. NewClientFromConnMgrState creates a new V1 API client with an IP address from the state of the consul-server-connection-manager.
Types ¶
type DynamicClient ¶
type DynamicClient struct { ConsulClient *capi.Client Config *Config // contains filtered or unexported fields }
func NewDynamicClient ¶
func NewDynamicClient(config *capi.Config) (*DynamicClient, error)
func NewDynamicClientFromConnMgr ¶
func NewDynamicClientFromConnMgr(config *Config, watcher ServerConnectionManager) (*DynamicClient, error)
func (*DynamicClient) RefreshClient ¶
func (d *DynamicClient) RefreshClient() error
type MockServerConnectionManager ¶
MockServerConnectionManager is an autogenerated mock type for the ServerConnectionManager type
func NewMockServerConnectionManager ¶
func NewMockServerConnectionManager(t mockConstructorTestingTNewMockServerConnectionManager) *MockServerConnectionManager
NewMockServerConnectionManager creates a new instance of MockServerConnectionManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockServerConnectionManager) Run ¶
func (_m *MockServerConnectionManager) Run()
Run provides a mock function with given fields:
func (*MockServerConnectionManager) State ¶
func (_m *MockServerConnectionManager) State() (discovery.State, error)
State provides a mock function with given fields:
func (*MockServerConnectionManager) Stop ¶
func (_m *MockServerConnectionManager) Stop()
Stop provides a mock function with given fields: