watchers

package
v1.2.3-fred.12 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright 2022 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	// Get returns cloud databases matching the fetcher's selector.
	Get(context.Context) (types.Databases, error)
}

Fetcher fetches cloud databases.

type Watcher

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

Watcher monitors cloud databases according to the provided selectors.

func NewWatcher

func NewWatcher(ctx context.Context, config WatcherConfig) (*Watcher, error)

NewWatcher returns a new instance of a cloud databases watcher.

func (*Watcher) DatabasesC

func (w *Watcher) DatabasesC() <-chan types.Databases

DatabasesC returns a channel that receives fetched cloud databases.

func (*Watcher) Start

func (w *Watcher) Start()

Start starts fetching cloud databases and sending them to the channel.

TODO(r0mant): In future, instead of (or in addition to) polling, we can use a combination of EventBridge (former CloudWatch Events) and SQS/SNS to subscribe to events such as created/removed instances and tag changes, but this will require Teleport to have more AWS permissions.

type WatcherConfig

type WatcherConfig struct {
	// AWSMatchers is a list of matchers for AWS databases.
	AWSMatchers []services.AWSMatcher
	// AzureMatchers is a list of matchers for Azure databases.
	AzureMatchers []services.AzureMatcher
	// Clients provides cloud API clients.
	Clients cloud.Clients
	// Interval is the interval between fetches.
	Interval time.Duration
}

WatcherConfig is the cloud watcher configuration.

func (*WatcherConfig) CheckAndSetDefaults

func (c *WatcherConfig) CheckAndSetDefaults() error

CheckAndSetDefaults validates the config.

Jump to

Keyboard shortcuts

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