Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { // Get value by a given key Get(key string) ([]byte, error) // Set value Set(key string, value []byte, expiration time.Duration) error }
Cache interface
type Effect ¶
type Effect interface { // ID that identifies the effect ID() string // Description of the effect Description() string // Parameters required for the transform Parameters() Parameters // Transform applies the specific transformation to the given image Transform(img image.Image, params map[string]interface{}) (image.Image, error) }
Effect represents an image transformation (ex: rotate, resize, overlay...)
type EffectRepository ¶
type EffectRepository interface { // GetEffects return all available effects GetEffects() ([]Effect, error) // GetEffect returns an effect by the given id GetEffect(id string) (Effect, error) }
EffectRepository to store effects
type Filter ¶
type Filter struct { // ID of the effect ID string `json:"id" bson:"filters"` // Parameters to apply Parameters map[string]interface{} `json:"parameters" bson:"parameters"` }
Filter represents an effect with all parameters
type ImageRepository ¶
type ImageRepository interface { // Get an image by the given path Get(path string) (image.Image, string, error) }
ImageRepository interface layer to get images
type ImageService ¶
type ImageService interface { // Effects returns all available effects for the image Effects() ([]Effect, error) // Effect returns a effect by the given ID Effect(id string) (Effect, error) // Process an image with a set of filters Process(imgSrc string, filters []Filter) (image.Image, string, error) }
ImageService interface has the logic for processing images by the given a list of filters
type Parameter ¶
type Parameter struct { Description string `json:"description"` Required bool `json:"required"` Type string `json:"type"` Example interface{} `json:"example"` Default interface{} `json:"default,omitempty"` Values interface{} `json:"values,omitempty"` }
Parameter contains all properties of a single effect parameter
type Parameters ¶
Parameters it's a map that contains all parameters of an effect
type Profile ¶
type Profile struct { ID string `json:"id" bson:"_id"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` Filters []Filter `json:"filters" bson:"filters"` }
Profile that represents a set of effects
Click to show internal directories.
Click to hide internal directories.