aws

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package aws provides the Controller struct that wraps AWS services and provides S3 and SSM functionality with context and logging support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller represents a wrapper for Controller services providing S3 and SSM functionality with context and logging support.

func NewController

func NewController(opts ...Option) (*Controller, error)

NewController initializes a Controller with customizable options and default configurations if unspecified. It returns an instance of the Controller struct and an error if any required initialization steps fail.

func (*Controller) GetSecret

func (a *Controller) GetSecret(key string, encrypted bool) (*string, error)

GetSecret retrieves a secret value from Controller SSM Parameter Store using the provided key. If encrypted is true, the secret is returned decrypted. Returns the secret value as a string pointer or an error if retrieval fails.

func (*Controller) PutS3Object

func (a *Controller) PutS3Object(id string, bucket string, body []byte) error

PutS3Object uploads a JSON object to the specified S3 bucket with a key formatted as a timestamp and the provided ID. The method takes the event type, bucket name, and the object body as a byte slice as parameters. Returns an error if the S3 upload fails or if the bucket name is empty.

type Option

type Option func(*Controller)

Option defines a function type used to configure an instance of the Controller struct.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets a custom context to be used by the Controller instance for request operations.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets a custom slog.Logger instance for the Controller struct to use for logging operations.

Jump to

Keyboard shortcuts

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