file

package
v0.0.0-...-b98e79d Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package file provides a imageserver.Server implementation that get the Image from a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdentifyMime

func IdentifyMime(pth string, data []byte) (format string, err error)

IdentifyMime identifies the Image format with the "mime" package.

Types

type Server

type Server struct {
	// Root is the directory where images are loaded from.
	Root string

	// Identify identifies the Image format.
	// By default, it uses IdentifyMime().
	Identify func(pth string, data []byte) (format string, err error)
}

Server is a imageserver.Server implementation that get the Image from a file.

It takes the "source" param and loads it from the Root directory. It expects a slash separated path.

func (*Server) Get

func (srv *Server) Get(params imageserver.Params) (*imageserver.Image, error)

Get implements imageserver.Server.

Jump to

Keyboard shortcuts

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