core

package
v0.0.0-...-3c9d484 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(r *St, maxCount int, ttl time.Duration) *Cache

func (*Cache) GenerateKey

func (c *Cache) GenerateKey(reqPath string, imgPars *types.ImgParsSt, download bool) string

func (*Cache) GetAndRefresh

func (c *Cache) GetAndRefresh(key string) (string, time.Time, []byte)

func (*Cache) Set

func (c *Cache) Set(key string, name string, mt time.Time, data []byte)

func (*Cache) Start

func (c *Cache) Start()

type Clean

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

func NewClean

func NewClean(r *St, cleaner cleaner.Cleaner) *Clean

func (*Clean) Clean

func (c *Clean) Clean(checkChunkSize int)

type Img

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

func NewImg

func NewImg(r *St, wMarkPath string, wMarkOpacity float64) *Img

func (*Img) Handle

func (c *Img) Handle(fPath string, w io.Writer, pars *types.ImgParsSt) error

func (*Img) Start

func (c *Img) Start()

type Kvs

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

func NewKvs

func NewKvs(r *St) *Kvs

func (*Kvs) Get

func (c *Kvs) Get(key string) ([]byte, time.Time, error)

func (*Kvs) Remove

func (c *Kvs) Remove(key string) error

func (*Kvs) Set

func (c *Kvs) Set(key string, file io.Reader) error

func (*Kvs) Start

func (c *Kvs) Start()

type St

type St struct {
	Static *Static
	Img    *Img
	Zip    *Zip
	Cache  *Cache
	Clean  *Clean
	Kvs    *Kvs
	// contains filtered or unexported fields
}

func New

func New(
	lg logger.Lite,
	cleaner cleaner.Cleaner,
	dirPath string,
	imgMaxWidth int,
	imgMaxHeight int,
	wMarkPath string,
	wMarkOpacity float64,
	wMarkDirPaths []string,
	cacheCount int,
	cacheTtl time.Duration,
	testing bool,
) *St

func (*St) IsStopped

func (c *St) IsStopped() bool

func (*St) Start

func (c *St) Start()

func (*St) StopAndWaitJobs

func (c *St) StopAndWaitJobs()

type Static

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

func NewStatic

func NewStatic(r *St) *Static

func (*Static) Create

func (c *Static) Create(reqDir string, reqFileName string, reqFile io.Reader, noCut bool, unZip bool) (string, error)

func (*Static) Get

func (c *Static) Get(reqPath string, imgPars *types.ImgParsSt, download bool) (string, time.Time, []byte, error)

type Zip

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

func NewZip

func NewZip(r *St) *Zip

func (*Zip) CompressDir

func (c *Zip) CompressDir(dirPath string) (*bytes.Buffer, error)

func (*Zip) Extract

func (c *Zip) Extract(archive io.Reader, dstDirPath string) error

Jump to

Keyboard shortcuts

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