amazon

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Contains a set of method for getting EC2 information

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadingAwsConfigFile = errors.New("failed to load AWS credentials config file")
)

Functions

func NewCloudWatchClient

func NewCloudWatchClient(ctx context.Context, cfg *aws.Config) *cloudWatchClient

New cloudwatch client instance

func NewEC2Client

func NewEC2Client(cfg *aws.Config) *ec2Client

New instance

func SetupScrapers

func SetupScrapers(ctx context.Context, b *bus.Bus) []v1.Scraper

Types

type Client

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

Client contains the AWS config and service clients and is used to access the API

func New

func New(ctx context.Context, currentConfig *config.Account, customTransportConfig *config.TransportConfig) (*Client, error)

NewClient creates a struct with the AWS config, EC2 Client, and CloudWatch Client It allows to pass:

  • configFile: the location of the config file to load. If empty the default location of the credentials file (~/.aws/config) is used
  • profile: the name of the profile to use to load the credentials if empty the default credentials will be used

TODO: use options pattern

type Scraper

type Scraper struct {
	Done chan bool

	Client *Client

	Bus *bus.Bus
	// contains filtered or unexported fields
}

func (*Scraper) Start

func (s *Scraper) Start(ctx context.Context)

func (*Scraper) Stop

func (s *Scraper) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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