Documentation
¶
Index ¶
Constants ¶
View Source
const Name = "consul"
Variables ¶
View Source
var DefaultArguments = Config{ ResourceAttributes: ResourceAttributesConfig{ CloudRegion: rac.ResourceAttributeConfig{Enabled: true}, HostID: rac.ResourceAttributeConfig{Enabled: true}, HostName: rac.ResourceAttributeConfig{Enabled: true}, }, }
DefaultArguments holds default settings for Config.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Address is the address of the Consul server Address string `river:"address,attr,optional"` // Datacenter to use. If not provided, the default agent datacenter is used. Datacenter string `river:"datacenter,attr,optional"` // Token is used to provide a per-request ACL token which overrides the // agent's default (empty) token. Token is only required if // [Consul's ACL System](https://www.consul.io/docs/security/acl/acl-system) // is enabled. Token rivertypes.Secret `river:"token,attr,optional"` // Namespace is the name of the namespace to send along for the request // when no other Namespace is present in the QueryOptions Namespace string `river:"namespace,attr,optional"` // Allowlist of [Consul Metadata](https://www.consul.io/docs/agent/options#node_meta) // keys to use as resource attributes. MetaLabels []string `river:"meta,attr,optional"` // ResourceAttributes configuration for Consul detector ResourceAttributes ResourceAttributesConfig `river:"resource_attributes,block,optional"` }
The struct requires no user-specified fields by default as consul agent's default configuration will be provided to the API client. See `consul.go#NewDetector` for more information.
func (*Config) SetToDefault ¶
func (args *Config) SetToDefault()
SetToDefault implements river.Defaulter.
type ResourceAttributesConfig ¶
type ResourceAttributesConfig struct { CloudRegion rac.ResourceAttributeConfig `river:"cloud.region,block,optional"` HostID rac.ResourceAttributeConfig `river:"host.id,block,optional"` HostName rac.ResourceAttributeConfig `river:"host.name,block,optional"` }
ResourceAttributesConfig provides config for consul resource attributes.
func (*ResourceAttributesConfig) Convert ¶
func (r *ResourceAttributesConfig) Convert() map[string]interface{}
Click to show internal directories.
Click to hide internal directories.