encodercommon

package
v0.0.0-...-084929d Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSuperMod     = errors.New("不支持当前模式")
	ErrNotSuperEncoded = errors.New("不支持编码")
	ErrNotFindEncoder  = errors.New("无法找到编码器")

	// image
	ErrNotSuperImageMod = errors.New("不支持当前图片模式")
	ErrImageCorrupted   = errors.New("图片损坏")
	ErrImageFormat      = errors.New("图片格式错误")
	ErrImageDecode      = errors.New("图片解析错误")
)

Functions

This section is empty.

Types

type EncoderOption

type EncoderOption struct {
	//MaxSize uint
	MinSize int
}

func (*EncoderOption) SetOption

func (b *EncoderOption) SetOption(options ...Option) error

type EncoderPlugin

type EncoderPlugin interface {
	Encode(in []byte) (out []byte, err error) //编码
	Decode(in []byte) (out []byte, err error) //解码
	SetOption(options ...Option) error
	Mime() string // 数据mime
	Type() string // 数据后缀
}

* * 编码插件

type Option

type Option interface {
	Apply(*EncoderOption) error
}

func WithMinSize

func WithMinSize(t int) Option

设置最小大小,如果为负值则设置为相对最小

Jump to

Keyboard shortcuts

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