scaleway

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 13 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            `river:"project_id,attr"`
	Role            Role              `river:"role,attr"`
	APIURL          string            `river:"api_url,attr,optional"`
	Zone            string            `river:"zone,attr,optional"`
	AccessKey       string            `river:"access_key,attr"`
	SecretKey       rivertypes.Secret `river:"secret_key,attr,optional"`
	SecretKeyFile   string            `river:"secret_key_file,attr,optional"`
	NameFilter      string            `river:"name_filter,attr,optional"`
	TagsFilter      []string          `river:"tags_filter,attr,optional"`
	RefreshInterval time.Duration     `river:"refresh_interval,attr,optional"`
	Port            int               `river:"port,attr,optional"`

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

func (*Arguments) Convert

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

func (*Arguments) SetToDefault

func (args *Arguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*Arguments) Validate

func (args *Arguments) Validate() error

Validate implements river.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