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

stackit

package
v0.313.5 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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSDConfig = SDConfig{
	Region:           "eu01",
	Port:             80,
	RefreshInterval:  model.Duration(60 * time.Second),
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultSDConfig is the default STACKIT SD configuration.

Functions

func NewDiscovery

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

NewDiscovery returns a new Discovery which periodically refreshes its targets.

Types

type Discovery

type Discovery struct {
	*refresh.Discovery
}

Discovery periodically performs STACKIT API requests. It implements the Discoverer interface.

type SDConfig

type SDConfig struct {
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`

	Project               string         `yaml:"project"`
	RefreshInterval       model.Duration `yaml:"refresh_interval,omitempty"`
	Port                  int            `yaml:"port,omitempty"`
	Region                string         `yaml:"region,omitempty"`
	Endpoint              string         `yaml:"endpoint,omitempty"`
	ServiceAccountKey     config.Secret  `yaml:"service_account_key,omitempty"`
	PrivateKey            config.Secret  `yaml:"private_key,omitempty"`
	ServiceAccountKeyPath string         `yaml:"service_account_key_path,omitempty"`
	PrivateKeyPath        string         `yaml:"private_key_path,omitempty"`
	CredentialsFilePath   string         `yaml:"credentials_file_path,omitempty"`
	// contains filtered or unexported fields
}

SDConfig is the configuration for STACKIT 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

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.

type Server

type Server struct {
	AvailabilityZone string          `json:"availabilityZone"`
	ID               string          `json:"id"`
	Labels           map[string]any  `json:"labels"`
	MachineType      string          `json:"machineType"`
	Name             string          `json:"name"`
	Nics             []ServerNetwork `json:"nics"`
	PowerStatus      string          `json:"powerStatus"`
	Status           string          `json:"status"`
}

type ServerListResponse

type ServerListResponse struct {
	Items *[]Server `json:"items"`
}

ServerListResponse Response object for server list request. https://docs.api.eu01.stackit.cloud/documentation/iaas/version/v1#tag/Servers/operation/v1ListServersInProject

type ServerNetwork

type ServerNetwork struct {
	NetworkName string  `json:"networkName"`
	IPv4        *string `json:"ipv4,omitempty"`
	PublicIP    *string `json:"publicIp,omitempty"`
}

ServerNetwork Describes the object that matches servers to its networks.

Jump to

Keyboard shortcuts

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