Documentation
¶
Overview ¶
Copyright © 2025 Juliano Martinez <juliano@martinez.io>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
Service(string, *api.QueryOptions) (*api.AgentService, *api.QueryMeta, error)
ServiceRegister(*api.AgentServiceRegistration) error
}
Agent is an interface for the Consul agent.
type ApiWrapper ¶
type ApiWrapper struct {
// contains filtered or unexported fields
}
ApiWrapper wraps the Consul API client to conform to the Client interface.
func NewConsulAPIWrapper ¶
func NewConsulAPIWrapper(client *api.Client) *ApiWrapper
NewConsulAPIWrapper creates a new instance of ApiWrapper.
func (*ApiWrapper) Agent ¶
func (w *ApiWrapper) Agent() Agent
Agent returns an object that conforms to the Agent interface.
type Client ¶
type Client interface {
Agent() Agent
}
Client is an interface for the Consul client.
func CreateClient ¶
CreateClient is a convenience function that uses the global factory
type ClientFactory ¶
ClientFactory is an interface for creating Consul clients
var Factory ClientFactory = &DefaultFactory{}
Factory is the global factory instance (can be overridden for testing)
type MockFactory ¶
MockFactory creates mock Consul clients for testing