aws

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAWSKeys

func WithAWSKeys(accessKey, secretKey, region string) func(*Catalog) error

WithAWSKeys enables explicitly setting the AWS access key, secret key and region

Types

type Catalog

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

Catalog manages the AWS S3 template catalog

func NewCatalog

func NewCatalog(bucket string, configurations ...func(*Catalog) error) (Catalog, error)

NewCatalog creates a new AWS Catalog object given a required S3 bucket name and optional configurations. If no configurations to set AWS keys are provided then environment variables will be used to obtain AWS credentials.

func (Catalog) GetTemplatePath

func (c Catalog) GetTemplatePath(target string) ([]string, error)

GetTemplatePath looks for a target string performing a simple substring check against all S3 keys. If the input includes a wildcard (*) it is removed.

func (Catalog) GetTemplatesPath

func (c Catalog) GetTemplatesPath(definitions []string) ([]string, map[string]error)

GetTemplatesPath returns all templates from S3

func (Catalog) OpenFile

func (c Catalog) OpenFile(filename string) (io.ReadCloser, error)

OpenFile downloads a file from S3 and returns the contents as an io.ReadCloser

func (Catalog) ResolvePath

func (c Catalog) ResolvePath(templateName, second string) (string, error)

ResolvePath gets a full S3 key given the first param. If the second parameter is provided it tries to find paths relative to the second path.

Jump to

Keyboard shortcuts

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