imgconv

package
v0.0.0-...-5094cac Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = 2

Variables

View Source
var Version string

Provided at compile time

Functions

func CreateLogger

func CreateLogger(logPaths []string) *zap.Logger

CreateLogger creates and returns a new logger.

func InitTest

func InitTest()

InitTest moves working directory to project root directory. https://brandur.org/fragments/testing-go-project-root

Types

type Config

type Config struct {
	Region               string
	AccessKeyID          string
	SecretAccessKey      string
	BaseURL              string
	S3StorageClass       s3types.StorageClass
	SQSQueueURL          string
	SQSVisibilityTimeout uint
	MaxFileSize          int64
	WebPQuality          uint8
	WorkerCount          uint8
	RetrieverCount       uint8
	DeleterCount         uint8
	OrderStop            time.Duration
	UglifyJSPath         string
	Log                  *zap.Logger
}

Config specifies configuration values given by CloudFormation Stack.

type Environment

type Environment struct {
	Config
	AWSConfig *aws.Config
	S3Client  *s3.Client
	SQSClient *sqs.Client
	// contains filtered or unexported fields
}

Environment holds values needed to execute the entire program.

func NewEnvironment

func NewEnvironment(ctx context.Context, cfg *Config) *Environment

NewEnvironment initializes values needed for execution.

func (*Environment) Convert

func (e *Environment) Convert(ctx context.Context, path string, src, dest *Location) error

Convert converts an image to WebP

func (*Environment) ConvertSQSCLI

func (e *Environment) ConvertSQSCLI(ctx context.Context)

ConvertSQSCLI converts image tasks retrieved from SQS.

func (*Environment) ConvertSQSLambda

func (e *Environment) ConvertSQSLambda(ctx context.Context)

ConvertSQSLambda converts image tasks retrieved from SQS.

type Location

type Location struct {
	Bucket string `json:"bucket"`
	Prefix string `json:"prefix"`
}

type TestSuite

type TestSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

TestSuite holds configs and sessions required to execute program.

Jump to

Keyboard shortcuts

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