pool

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 13

Documentation

Overview

Package pool 图片缓存池

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrImgFileOutdated = errors.New("img file outdated")
	ErrNoSuchImg       = errors.New("no such img")
	ErrSendImg         = errors.New("send image error")
	ErrGetMsg          = errors.New("get msg error")
)
View Source
var (
	ErrInvalidNTURL = errors.New("invalid nt url")
	ErrInvalidNTRaw = errors.New("invalid nt raw")
)

Functions

func SendImageFromPool

func SendImageFromPool(imgname, imgpath string, genimg func() error, send ctxext.NoCtxSendMsg, get ctxext.NoCtxGetMsg) error

SendImageFromPool ...

func SendRemoteImageFromPool

func SendRemoteImageFromPool(imgname, imgurl string, send ctxext.NoCtxSendMsg, get ctxext.NoCtxGetMsg) error

SendRemoteImageFromPool ...

Types

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image 图片数据

func GetImage

func GetImage(name string) (m *Image, err error)

GetImage name

func NewImage

func NewImage(send ctxext.NoCtxSendMsg, get ctxext.NoCtxGetMsg, name, f string) (m *Image, hassent bool, err error)

NewImage context name file

func (*Image) Push

func (m *Image) Push(send ctxext.NoCtxSendMsg, get ctxext.NoCtxGetMsg) (hassent bool, err error)

Push context

func (*Image) SetFile

func (m *Image) SetFile(f string)

SetFile f

func (*Image) String

func (m *Image) String() string

String url

Jump to

Keyboard shortcuts

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