scaleway

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	APIURL:          "https://api.scaleway.com",
	Zone:            scw.ZoneFrPar1.String(),
	RefreshInterval: 60 * time.Second,
	Port:            80,

	FollowRedirects: true,
	EnableHTTP2:     true,
}

Functions

func New

func New(opts component.Options, args Arguments) (*discovery.Component, error)

New returns a new instance of a discovery.scaleway component.

Types

type Arguments

type Arguments struct {
	Project         string            `alloy:"project_id,attr"`
	Role            Role              `alloy:"role,attr"`
	APIURL          string            `alloy:"api_url,attr,optional"`
	Zone            string            `alloy:"zone,attr,optional"`
	AccessKey       string            `alloy:"access_key,attr"`
	SecretKey       alloytypes.Secret `alloy:"secret_key,attr,optional"`
	SecretKeyFile   string            `alloy:"secret_key_file,attr,optional"`
	NameFilter      string            `alloy:"name_filter,attr,optional"`
	TagsFilter      []string          `alloy:"tags_filter,attr,optional"`
	RefreshInterval time.Duration     `alloy:"refresh_interval,attr,optional"`
	Port            int               `alloy:"port,attr,optional"`

	ProxyConfig     *config.ProxyConfig `alloy:",squash"`
	TLSConfig       config.TLSConfig    `alloy:"tls_config,block,optional"`
	FollowRedirects bool                `alloy:"follow_redirects,attr,optional"`
	EnableHTTP2     bool                `alloy:"enable_http2,attr,optional"`
}

func (*Arguments) Convert

func (args *Arguments) Convert() *prom_discovery.SDConfig

func (*Arguments) SetToDefault

func (args *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*Arguments) Validate

func (args *Arguments) Validate() error

Validate implements syntax.Validator.

type Role

type Role string

Role is the role of the target within the Scaleway Ecosystem.

const (
	// RoleBaremetal represents a Scaleway Elements Baremetal server.
	RoleBaremetal Role = "baremetal"

	// RoleInstance represents a Scaleway Elements Instance virtual server.
	RoleInstance Role = "instance"
)

func (Role) MarshalText

func (r Role) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler, returning the raw bytes of the Role.

func (*Role) UnmarshalText

func (r *Role) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler. UnmarshalText returns an error if the text is not recognized as a valid Role.

Jump to

Keyboard shortcuts

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