s3_fetcher

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 5 Imported by: 2

README

S3 Fetcher

Compatible with Logz.io's S3 Fetcher API.

To create a new S3 fetcher:

client, _ := s3_fetcher.New(apiToken, test_utils.GetLogzIoBaseUrl())
addS3Buckt := false
active := true
connector, err := underTest.CreateS3Fetcher(s3_fetcher.S3FetcherRequest{
                        Bucket:                   "my_bucket",
                        AddS3ObjectKeyAsLogField: &addS3Buckt,
                        Active:                   &active,
                        Region:                   s3_fetcher.RegionUsEast1,
                        LogsType:                 s3_fetcher.LogsTypeElb,
                    })
Function Function Name
Create func (c *S3FetcherClient) CreateS3Fetcher(create S3FetcherRequest) (*S3FetcherResponse, error)
Delete func (c *S3FetcherClient) DeleteS3Fetcher(s3FetcherId int64) error
Get func (c *S3FetcherClient) GetS3Fetcher(s3FetcherId int64) (*S3FetcherResponse, error)
List func (c *S3FetcherClient) ListS3Fetchers() ([]S3FetcherResponse, error)
Update func (c *S3FetcherClient) UpdateS3Fetcher(s3FetcherId int64, update S3FetcherRequest) error

Documentation

Index

Constants

View Source
const (
	RegionUsEast1      AwsRegion = "US_EAST_1"
	RegionUsEast2      AwsRegion = "US_EAST_2"
	RegionUsWest1      AwsRegion = "US_WEST_1"
	RegionUsWest2      AwsRegion = "US_WEST_2"
	RegionEuWest1      AwsRegion = "EU_WEST_1"
	RegionEuWest2      AwsRegion = "EU_WEST_2"
	RegionEuWest3      AwsRegion = "EU_WEST_3"
	RegionEuCentral1   AwsRegion = "EU_CENTRAL_1"
	RegionApNortheast1 AwsRegion = "AP_NORTHEAST_1"
	RegionApNortheast2 AwsRegion = "AP_NORTHEAST_2"
	RegionApSoutheast1 AwsRegion = "AP_SOUTHEAST_1"
	RegionApSoutheast2 AwsRegion = "AP_SOUTHEAST_2"
	RegionSaEast1      AwsRegion = "SA_EAST_1"
	RegionApSouth1     AwsRegion = "AP_SOUTH_1"
	RegionCaCentral1   AwsRegion = "CA_CENTRAL_1"

	LogsTypeElb        AwsLogsType = "elb"
	LogsTypeVpcFlow    AwsLogsType = "vpcflow"
	LogsTypeS3Access   AwsLogsType = "S3Access"
	LogsTypeCloudfront AwsLogsType = "cloudfront"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsLogsType

type AwsLogsType string

func GetValidLogsType

func GetValidLogsType() []AwsLogsType

func (AwsLogsType) String

func (t AwsLogsType) String() string

type AwsRegion

type AwsRegion string

func GetValidRegions

func GetValidRegions() []AwsRegion

func (AwsRegion) String

func (r AwsRegion) String() string

type S3FetcherClient

type S3FetcherClient struct {
	*client.Client
}

func New

func New(apiToken, baseUrl string) (*S3FetcherClient, error)

func (*S3FetcherClient) CreateS3Fetcher

func (c *S3FetcherClient) CreateS3Fetcher(create S3FetcherRequest) (*S3FetcherResponse, error)

CreateS3Fetcher creates a new S3 fetcher if successful, an error otherwise

func (*S3FetcherClient) DeleteS3Fetcher

func (c *S3FetcherClient) DeleteS3Fetcher(s3FetcherId int64) error

DeleteS3Fetcher deletes a s3 fetcher specified by its unique id, returns an error if a problem is encountered

func (*S3FetcherClient) GetS3Fetcher

func (c *S3FetcherClient) GetS3Fetcher(s3FetcherId int64) (*S3FetcherResponse, error)

GetS3Fetcher returns a s3 fetcher given its unique identifier, an error otherwise

func (*S3FetcherClient) ListS3Fetchers

func (c *S3FetcherClient) ListS3Fetchers() ([]S3FetcherResponse, error)

ListS3Fetchers returns all the s3 fetchers in an array, returns an error if any problem occurs during the API call

func (*S3FetcherClient) UpdateS3Fetcher

func (c *S3FetcherClient) UpdateS3Fetcher(s3FetcherId int64, update S3FetcherRequest) error

type S3FetcherRequest

type S3FetcherRequest struct {
	AccessKey                string      `json:"accessKey,omitempty"`
	SecretKey                string      `json:"secretKey,omitempty"`
	Arn                      string      `json:"arn,omitempty"`
	Bucket                   string      `json:"bucket"`
	Prefix                   string      `json:"prefix,omitempty"`
	Active                   *bool       `json:"active"`
	AddS3ObjectKeyAsLogField *bool       `json:"addS3ObjectKeyAsLogField,omitempty"`
	Region                   AwsRegion   `json:"region"`
	LogsType                 AwsLogsType `json:"logsType"`
}

type S3FetcherResponse

type S3FetcherResponse struct {
	AccessKey                string      `json:"accessKey,omitempty"`
	Arn                      string      `json:"arn,omitempty"`
	Bucket                   string      `json:"bucket"`
	Prefix                   string      `json:"prefix,omitempty"`
	Active                   bool        `json:"active"`
	AddS3ObjectKeyAsLogField bool        `json:"addS3ObjectKeyAsLogField,omitempty"`
	Region                   AwsRegion   `json:"region"`
	LogsType                 AwsLogsType `json:"logsType"`
	Id                       int64       `json:"id,omitempty"`
}

Jump to

Keyboard shortcuts

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