core

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "1.18.0"

VERSION number of current image server

Variables

View Source
var BuildTimestamp = "BuildTimestamp is not defined"

BuildTimestamp is the build time stamp and is set at build time as a ldflags

View Source
var GitHash = "GitHash is not defined"

GitHash is the git hash and is set at build time as a ldflags

Functions

This section is empty.

Types

type Adapters

type Adapters struct {
	Fetcher Fetcher
	Paths   Paths
}

type Fetcher

type Fetcher interface {
	Fetch(string, string) error
}

type ImageConfiguration

type ImageConfiguration struct {
	// ServerConfiguration *ServerConfiguration
	ID        string
	Width     int
	Height    int
	Filename  string
	Format    string
	Source    string
	Quality   uint
	Namespace string
}

ImageConfiguration struct Properties used to generate new image

func (*ImageConfiguration) ToContentType

func (ic *ImageConfiguration) ToContentType() string

ToContentType returns the content type based on the image format

type Logger

type Logger interface {
	ImagePosted()
	ImagePostingFailed()
	ImageProcessed(ic *ImageConfiguration)
	ImageAlreadyProcessed(ic *ImageConfiguration)
	ImageProcessedWithErrors(ic *ImageConfiguration)
	AllImagesAlreadyProcessed(namespace string, hash string, sourceURL string)
	SourceDownloaded()
	OriginalDownloaded(source string, destination string)
	OriginalDownloadFailed(source string)
	OriginalDownloadSkipped(source string)
	RequestLatency(handler string, since time.Time)
}

type Paths

type Paths interface {
	LocalInfoPath(string, string) string
	RemoteInfoPath(string, string) string
	TempImagePath(string) string
	RandomTempPath() string
	LocalOriginalPath(string, string) string
	LocalImagePath(namespace string, md5 string, imageName string) string
	LocalImageDirectory(namespace string, md5 string) string
	RemoteImageDirectory(namespace string, md5 string) string
	RemoteOriginalPath(string, string) string
	RemoteOriginalURL(string, string) string
	RemoteImagePath(namespace string, md5 string, imageName string) string
	RemoteImageURL(namespace string, md5 string, imageName string) string
}

Paths

type Processor

type Processor interface {
	CreateImage() error
}

Processor

type ServerConfiguration

type ServerConfiguration struct {
	WhitelistedExtensions []string
	MaximumWidth          int
	LocalBasePath         string
	RemoteBasePath        string
	RemoteBaseURL         string
	DefaultQuality        uint
	UploaderConcurrency   uint
	ProcessorConcurrency  uint
	HTTPTimeout           time.Duration
	Adapters              *Adapters
	Outputs               string
	AWSAccessKeyID        string
	AWSSecretKey          string
	AWSBucket             string
	AWSRegion             string
	MantaURL              string
	MantaUser             string
	MantaKeyID            string
	SDCIdentity           string
	UploaderType          string
	CleanUpTicker         *time.Ticker
	MaxFileAge            time.Duration
}

ServerConfiguration struct

func (*ServerConfiguration) UploaderIsAws added in v1.18.0

func (sc *ServerConfiguration) UploaderIsAws() bool

func (*ServerConfiguration) UploaderIsManta added in v1.18.0

func (sc *ServerConfiguration) UploaderIsManta() bool

type SourceMapper

type SourceMapper interface {
	RemoteImageURL(*ImageConfiguration) string
}

SourceMapper

type Uploader

type Uploader interface {
	CreateDirectory(string) error
	Upload(string, string, string) error
	ListDirectory(string) ([]string, error)
}

Uploader

Jump to

Keyboard shortcuts

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