platform

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string `json:"error"`
}

APIError represents an error returned by the API.

func (APIError) Error

func (a APIError) Error() string

type AccessControlConfig

type AccessControlConfig struct {
	MaxSecuredRoutes int `json:"maxSecuredRoutes"`
}

AccessControlConfig holds the configuration of the access control section of the offer config.

type Client

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

Client allows interacting with the cluster service.

func NewClient

func NewClient(baseURL, token string) (*Client, error)

NewClient creates a new client for the cluster service.

func (*Client) GetConfig

func (c *Client) GetConfig(ctx context.Context) (Config, error)

GetConfig returns the agent configuration.

func (c *Client) Link(ctx context.Context) (clusterID string, err error)

Link links the agent to the Hub platform.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Ping sends a ping to the platform to inform that the agent is alive.

type Config

type Config struct {
	Metrics       MetricsConfig       `json:"metrics"`
	Topology      TopologyConfig      `json:"topology"`
	AccessControl AccessControlConfig `json:"accessControl"`
}

Config holds the configuration of the agent.

type ConfigWatcher

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

ConfigWatcher watches hub agent configuration.

func NewConfigWatcher

func NewConfigWatcher(interval time.Duration, c *Client) *ConfigWatcher

NewConfigWatcher return a new ConfigWatcher.

func (*ConfigWatcher) AddListener

func (w *ConfigWatcher) AddListener(listener func(cfg Config))

AddListener adds a listeners to the ConfigWatcher.

func (*ConfigWatcher) Run

func (w *ConfigWatcher) Run(ctx context.Context)

Run runs ConfigWatcher.

type MetricsConfig

type MetricsConfig struct {
	Interval time.Duration `json:"interval"`
	Tables   []string      `json:"tables"`
}

MetricsConfig holds the metrics part of the agent config.

type TopologyConfig

type TopologyConfig struct {
	GitProxyHost string `json:"gitProxyHost,omitempty"`
	GitOrgName   string `json:"gitOrgName,omitempty"`
	GitRepoName  string `json:"gitRepoName,omitempty"`
}

TopologyConfig holds the topology part of the agent config.

Jump to

Keyboard shortcuts

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