mill

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMediaTypeNotSupported = fmt.Errorf("media type not supported")

Functions

This section is empty.

Types

type Blob

type Blob struct{}

func (*Blob) AcceptMedia

func (m *Blob) AcceptMedia(media string) error

func (*Blob) Encrypt

func (m *Blob) Encrypt() bool

func (*Blob) ID

func (m *Blob) ID() string

func (*Blob) Mill

func (m *Blob) Mill(input []byte, name string) (*Result, error)

func (*Blob) Options

func (m *Blob) Options(add map[string]interface{}) (string, error)

func (*Blob) Pin

func (m *Blob) Pin() bool

type Format

type Format string

Format enumerates the type of images currently supported

const (
	JPEG Format = "jpeg"
	PNG  Format = "png"
	GIF  Format = "gif"
)

type ImageExif

type ImageExif struct{}

func (*ImageExif) AcceptMedia

func (m *ImageExif) AcceptMedia(media string) error

func (*ImageExif) Encrypt

func (m *ImageExif) Encrypt() bool

func (*ImageExif) ID

func (m *ImageExif) ID() string

func (*ImageExif) Mill

func (m *ImageExif) Mill(input []byte, name string) (*Result, error)

func (*ImageExif) Options

func (m *ImageExif) Options(add map[string]interface{}) (string, error)

func (*ImageExif) Pin

func (m *ImageExif) Pin() bool

type ImageExifSchema

type ImageExifSchema struct {
	Created   time.Time `json:"created,omitempty"`
	Name      string    `json:"name"`
	Ext       string    `json:"extension"`
	Width     int       `json:"width"`
	Height    int       `json:"height"`
	Format    string    `json:"format"`
	Latitude  float64   `json:"latitude,omitempty"`
	Longitude float64   `json:"longitude,omitempty"`
}

type ImageResize

type ImageResize struct {
	Opts ImageResizeOpts
}

func (*ImageResize) AcceptMedia

func (m *ImageResize) AcceptMedia(media string) error

func (*ImageResize) Encrypt

func (m *ImageResize) Encrypt() bool

func (*ImageResize) ID

func (m *ImageResize) ID() string

func (*ImageResize) Mill

func (m *ImageResize) Mill(input []byte, name string) (*Result, error)

func (*ImageResize) Options

func (m *ImageResize) Options(add map[string]interface{}) (string, error)

func (*ImageResize) Pin

func (m *ImageResize) Pin() bool

type ImageResizeOpts

type ImageResizeOpts struct {
	Width   string `json:"width"`
	Quality string `json:"quality"`
}

type ImageSize

type ImageSize struct {
	Width  int
	Height int
}

type Json

type Json struct{}

func (*Json) AcceptMedia

func (m *Json) AcceptMedia(media string) error

func (*Json) Encrypt

func (m *Json) Encrypt() bool

func (*Json) ID

func (m *Json) ID() string

func (*Json) Mill

func (m *Json) Mill(input []byte, name string) (*Result, error)

func (*Json) Options

func (m *Json) Options(add map[string]interface{}) (string, error)

func (*Json) Pin

func (m *Json) Pin() bool

type Mill

type Mill interface {
	ID() string
	Encrypt() bool // encryption allowed
	Pin() bool     // pin by default
	AcceptMedia(media string) error
	Options(add map[string]interface{}) (string, error)
	Mill(input []byte, name string) (*Result, error)
}

type Result

type Result struct {
	File []byte
	Meta map[string]interface{}
}

type Schema

type Schema struct{}

func (*Schema) AcceptMedia

func (m *Schema) AcceptMedia(media string) error

func (*Schema) Encrypt

func (m *Schema) Encrypt() bool

func (*Schema) ID

func (m *Schema) ID() string

func (*Schema) Mill

func (m *Schema) Mill(input []byte, name string) (*Result, error)

func (*Schema) Options

func (m *Schema) Options(add map[string]interface{}) (string, error)

func (*Schema) Pin

func (m *Schema) Pin() bool

Jump to

Keyboard shortcuts

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