Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachingServer ¶
type CachingServer struct { MediaServer // contains filtered or unexported fields }
func NewCachingServer ¶
func NewCachingServer(server MediaServer, storage MediaStorage, cacheSize int) (*CachingServer, error)
type ClassParams ¶
type MediaGetter ¶
type MediaServer ¶
type MediaStorage ¶
type Option ¶
type Option func(s *options)
func WithClass ¶
func WithClass(name string, params ClassParams) Option
func WithClassResolver ¶
func WithClassResolver(r ClassResolver) Option
func WithPermaCache ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(storage MediaStorage, o ...Option) (*Server, func())
func (Server) GetImage ¶
func (s Server) GetImage(ctx context.Context, fname string, class string) (io.Reader, string, error)
get the reader with downloaded and transformed image after all transformations
func (Server) ServeImage ¶
func (s Server) ServeImage(ctx context.Context, getter MediaGetter, req *http.Request, w http.ResponseWriter, fname string) error
type ServerWrapper ¶
type ServerWrapper struct { MediaServer // contains filtered or unexported fields }
ServerWrapper wraps the media Server to provide request deduplication and concurrency limiting
func NewWrapper ¶
func NewWrapper(server MediaServer, maxConcurrent int64) *ServerWrapper
NewWrapper creates a new ServerWrapper with the given concurrency limit
Click to show internal directories.
Click to hide internal directories.