Help us shape the future of Go! Take the 2026 Go Developer Survey

openstack

package
v0.315.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 28 Imported by: 547

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSDConfig = SDConfig{
	Port:            80,
	RefreshInterval: model.Duration(60 * time.Second),
	Availability:    "public",
}

DefaultSDConfig is the default OpenStack SD configuration.

Functions

func NewDiscovery

func NewDiscovery(conf *SDConfig, opts discovery.DiscovererOptions) (*refresh.Discovery, error)

NewDiscovery returns a new OpenStack Discoverer which periodically refreshes its targets.

Types

type HypervisorDiscovery

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

HypervisorDiscovery discovers OpenStack hypervisors.

type InstanceDiscovery

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

InstanceDiscovery discovers OpenStack instances.

type LoadBalancerDiscovery added in v0.302.0

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

LoadBalancerDiscovery discovers OpenStack load balancers.

type Role

type Role string

Role is the role of the target in OpenStack.

const (
	// OpenStack document reference
	// https://docs.openstack.org/nova/pike/admin/arch.html#hypervisors
	OpenStackRoleHypervisor Role = "hypervisor"
	// OpenStack document reference
	// https://docs.openstack.org/horizon/pike/user/launch-instances.html
	OpenStackRoleInstance Role = "instance"
	// Openstack document reference
	// https://docs.openstack.org/openstacksdk/rocky/user/resources/load_balancer/index.html
	OpenStackRoleLoadBalancer Role = "loadbalancer"
)

The valid options for OpenStackRole.

func (*Role) UnmarshalYAML

func (c *Role) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type SDConfig

type SDConfig struct {
	IdentityEndpoint            string           `yaml:"identity_endpoint"`
	Username                    string           `yaml:"username"`
	UserID                      string           `yaml:"userid"`
	Password                    config.Secret    `yaml:"password"`
	ProjectName                 string           `yaml:"project_name"`
	ProjectID                   string           `yaml:"project_id"`
	DomainName                  string           `yaml:"domain_name"`
	DomainID                    string           `yaml:"domain_id"`
	ApplicationCredentialName   string           `yaml:"application_credential_name"`
	ApplicationCredentialID     string           `yaml:"application_credential_id"`
	ApplicationCredentialSecret config.Secret    `yaml:"application_credential_secret"`
	Role                        Role             `yaml:"role"`
	Region                      string           `yaml:"region"`
	RefreshInterval             model.Duration   `yaml:"refresh_interval"`
	Port                        int              `yaml:"port"`
	AllTenants                  bool             `yaml:"all_tenants,omitempty"`
	TLSConfig                   config.TLSConfig `yaml:"tls_config,omitempty"`
	Availability                string           `yaml:"availability,omitempty"`
}

SDConfig is the configuration for OpenStack based service discovery.

func (*SDConfig) Name

func (*SDConfig) Name() string

Name returns the name of the Config.

func (*SDConfig) NewDiscoverer

func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)

NewDiscoverer returns a Discoverer for the Config.

func (*SDConfig) NewDiscovererMetrics added in v0.50.0

NewDiscovererMetrics implements discovery.Config.

func (*SDConfig) SetDirectory

func (c *SDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*SDConfig) UnmarshalYAML

func (c *SDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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