Documentation
¶
Overview ¶
Copyright © 2022 Roberto Hidalgo <coredns-consul@un.rob.mx> Modified by Charles Powell, 2023 SPDX-License-Identifier: Apache-2.0
Copyright © 2022 Roberto Hidalgo <coredns-consul@un.rob.mx> Modified by Charles Powell, 2023 SPDX-License-Identifier: Apache-2.0
Copyright © 2022 Roberto Hidalgo <coredns-consul@un.rob.mx> Modified by Charles Powell, 2023 SPDX-License-Identifier: Apache-2.0
Copyright © 2022 Roberto Hidalgo <coredns-consul@un.rob.mx> SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func CreateClient(scheme, endpoint, token string) (catalog ClientCatalog, kv KVClient, err error)
- type Catalog
- func (c *Catalog) FetchConfig() error
- func (c *Catalog) FetchServices() error
- func (c *Catalog) LastUpdated() time.Time
- func (c *Catalog) Name() string
- func (c *Catalog) Ready() bool
- func (c *Catalog) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (c *Catalog) ServiceFor(name string) (svc *Service)
- func (c *Catalog) Services() map[string]*Service
- func (c *Catalog) SetClients(client ClientCatalog, kv KVClient)
- type ClientCatalog
- type KVClient
- type KVEntries
- type Service
- type ServiceACL
Constants ¶
This section is empty.
Variables ¶
var Log = clog.NewWithPlugin("consul_catalog")
Functions ¶
func CreateClient ¶
func CreateClient(scheme, endpoint, token string) (catalog ClientCatalog, kv KVClient, err error)
CreateClient initializes the consul catalog client.
Types ¶
type Catalog ¶
type Catalog struct {
sync.RWMutex
Endpoint string
Scheme string
Tag string
ACLIgnoreTag string
AliasTag string
FQDN []string
TTL uint32
Token string
ProxyService string
ProxyTag string
Networks map[string]*net.IPNet
MetadataTag string
ConfigKey string
Next plugin.Handler
Zone string
// contains filtered or unexported fields
}
Catalog holds published Consul Catalog services.
func (*Catalog) FetchConfig ¶
func (*Catalog) FetchServices ¶
FetchServices populates zones.
func (*Catalog) LastUpdated ¶
LastUpdated returns the last time services changed.
func (*Catalog) ServiceFor ¶
func (*Catalog) SetClients ¶
func (c *Catalog) SetClients(client ClientCatalog, kv KVClient)
SetClient sets a consul client for a catalog.
type ClientCatalog ¶
type ClientCatalog interface {
Service(string, string, *api.QueryOptions) ([]*api.CatalogService, *api.QueryMeta, error)
Services(*api.QueryOptions) (map[string][]string, *api.QueryMeta, error)
}
ClientCatalog is implemented by github.com/hashicorp/consul/api.Catalog.
type Service ¶
type Service struct {
Name string
Target string
ACL []*ServiceACL
Addresses []net.IP
ApplyACL bool
}
Service has a target and ACL rules.
type ServiceACL ¶
ServiceACL holds an action and corresponding network range.