imageStore

package
v0.0.0-...-2029094 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWebDN2ImgArray

func AddWebDN2ImgArray(webDN string, JSON [][]byte) []byte

Types

type ImageCmp

type ImageCmp struct{}

func (ImageCmp) Compare

func (ImageCmp) Compare(a, b []byte) int

func (ImageCmp) Name

func (ImageCmp) Name() string

func (ImageCmp) Separator

func (ImageCmp) Separator(dst, a, b []byte) []byte

func (ImageCmp) Successor

func (ImageCmp) Successor(dst, b []byte) []byte

type ImageInfo

type ImageInfo struct {
	ID     []byte `json:"id"`
	Name   string `json:"name"`
	Type   string `json:"type"`
	Src    string `json:"src"`
	Small  []byte `json:"small,omitempty"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type ImageStore

type ImageStore interface {
	Release()
	GetImageByID(id []byte) *ImageInfo
	GetImageByName(name []byte) []byte
	GetAllImageInfo(webAddr string, s, e int64) [][]byte
	//SaveImage, if id is nil, use a random id
	SaveImage(data io.Reader, name string, id []byte) ([]byte, error)
	RemoveImage(id []byte) error
}

func New

func New(mateDBPath, imagePath, globalDBPath string) ImageStore

New generate a ImageStore mateDBPath & imagePath: relative path, relative to the path globalDBPath

Jump to

Keyboard shortcuts

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