blobsrv

package
v0.0.0-...-9c71d87 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlobDeletionFun

func BlobDeletionFun(bd BlobDeleter, md MetadataDeleter, param string) func(http.ResponseWriter, *http.Request)

func GetBlobDataFun

func GetBlobDataFun(br BlobReader, bm BlobMeta, param string) func(http.ResponseWriter, *http.Request)

func GetThumbnailDataFun

func GetThumbnailDataFun(br BlobReader, bm BlobMeta, cache CacheProvider, blobParam, widthParam, heightParam string) func(http.ResponseWriter, *http.Request)

GetThumbnailDataFun returns a function which converts blobs into a thumbnail.

func PostBlobDataFun

func PostBlobDataFun(bw BlobWriter, ms MetadataSetter, param string) func(http.ResponseWriter, *http.Request)

Types

type BlobDeleter

type BlobDeleter interface {
	DeleteBlobData(context.Context, blid.Blid) (bool, error)
}

type BlobMeta

type BlobMeta interface {
	GetBlobMeta(context.Context, blid.Blid) (*metadata.Item, bool, error)
}

type BlobReader

type BlobReader interface {
	GetBlobReader(ctx context.Context, offset uint64, blobid blid.Blid) (io.ReadCloser, bool, error)
}

type BlobWriter

type BlobWriter interface {
	GetBlobWriter(context.Context, blid.Blid) (io.Writer, func(bool) error, error)
}

type CacheProvider

type CacheProvider interface {
	Get(ctx context.Context, key string) ([]byte, bool, error)
	Put(ctx context.Context, key string, pl []byte) error
}

type MetadataDeleter

type MetadataDeleter interface {
	DeleteBlobMeta(context.Context, blid.Blid) error
}

type MetadataSetter

type MetadataSetter interface {
	SetBlobMeta(context.Context, *metadata.Item) error
}

Jump to

Keyboard shortcuts

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