thumbs

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CatThumb = "thumb"
)

consts Cate of Key

Variables

This section is empty.

Functions

func WithLoader

func WithLoader(fn LoadFunc) func(*thumber)

func WithSizes

func WithSizes(ss ...uint) func(*thumber)

func WithWalker

func WithWalker(fn WalkFunc) func(*thumber)

func WithWaterOpacity

func WithWaterOpacity(opacity uint8) func(*thumber)

func WithWatermark

func WithWatermark(filename string) func(*thumber)

Types

type CodeError

type CodeError struct {
	Code int
	Text string
	Path string
}

CodeError ...

func NewCodeError

func NewCodeError(code int, text string) *CodeError

NewCodeError ...

func (*CodeError) Error

func (ie *CodeError) Error() string

Error ...

type File

type File interface {
	io.Reader
	io.Seeker

	Name() string
	Size() int64
	Modified() time.Time
}

File ...

type Item added in v1.5.5

type Item interface {
	GetID() string
	GetName() string
	GetRoof() string
	IsOrigin() bool
	GetOrigin() string
}

Item item for load and read

type LoadFunc

type LoadFunc func(Item) error

LoadFunc load by key and save it into a file

type Option

type Option func(*thumber)

type Thumber

type Thumber interface {
	Thumbnail(uri string) error
}

func New

func New(root string, opts ...Option) (Thumber, error)

type WalkFunc

type WalkFunc func(f File)

WalkFunc ..

Jump to

Keyboard shortcuts

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