traefik

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDomain = "TRAEFIK HUB AGENT DEFAULT CERT"

DefaultDomain Traefik domain for the default certificate.

Variables

This section is empty.

Functions

func DefaultCertificate

func DefaultCertificate() (*tls.Certificate, error)

DefaultCertificate generates random TLS certificates.

func KeyPair

func KeyPair(domain string, expiration time.Time) ([]byte, []byte, error)

KeyPair generates cert and key files.

func PemCert

func PemCert(privKey *rsa.PrivateKey, domain string, expiration time.Time) ([]byte, error)

PemCert generates PEM cert file.

Types

type Client

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

Client allows interacting with a Traefik instance.

func NewClient

func NewClient(baseURL string, insecure bool, ca, cert, key string) (*Client, error)

NewClient returns a new Client.

func (*Client) GetAgentReachableIP

func (c *Client) GetAgentReachableIP(ctx context.Context) (string, error)

GetAgentReachableIP returns an IP address the Hub provider can reach the Agent from.

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context) ([]*dto.MetricFamily, error)

GetMetrics returns the Traefik metrics.

func (*Client) GetProviderState

func (c *Client) GetProviderState(ctx context.Context) (ProviderState, error)

GetProviderState returns the current ProviderState.

func (*Client) PushDynamic

func (c *Client) PushDynamic(ctx context.Context, unixNano int64, cfg *dynamic.Configuration) error

PushDynamic pushes a dynamic configuration.

type ProviderState

type ProviderState struct {
	LastConfigUnixNano int64 `json:"lastConfigUnixNano"`
}

ProviderState is the state of a Hub provider.

Jump to

Keyboard shortcuts

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