Documentation ¶
Index ¶
- Constants
- func TileURL(name string, format pngtile.ImageFormat, params TileParams) (string, error)
- type Config
- type Image
- type ImageConfig
- type ImageResponse
- type IndexImage
- type IndexItem
- type IndexResponse
- type Server
- func (server *Server) Handle(r *http.Request) (httpResponse, error)
- func (server *Server) HandleImage(r *http.Request, name string) (httpResponse, error)
- func (server *Server) HandleImageTile(r *http.Request, name string, query url.Values) (httpResponse, error)
- func (server *Server) HandleIndex(r *http.Request, name string) (httpResponse, error)
- func (server *Server) ImageInfo(name string) (pngtile.ImageInfo, error)
- func (server *Server) ImageTile(name string, params pngtile.TileParams) ([]byte, error)
- func (server *Server) Images(name string) ([]string, error)
- func (server *Server) List(name string) (dirs []string, images []string, err error)
- func (server *Server) Lookup(url string, forceExt string) (path, name, ext string, err error)
- func (server *Server) Path(url, suffix string) (string, error)
- func (server *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (server *Server) URL(name string) string
- type TileParams
Constants ¶
View Source
const ( IndexWidth = 640 IndexHeight = 320 )
View Source
const TileLimit uint = 1920 * 1200
View Source
const TileSize uint = 256
View Source
const TileURLTemplate = "{url}?t={mtime}&tile-x={x}&tile-y={y}&zoom={z}" // tile image: xy are in units of scaled tiles
View Source
const TileZoomMax int = 4
View Source
const TileZoomMin int = 0
View Source
const ViewURLTemplate = "{url}?w={w}&h={h}&x={x}&y={y}&zoom={z}" // fullscreen/linked view image: xy is the scaled center point of the wh viewport
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
func (Config) MakeServer ¶
type ImageConfig ¶
type ImageConfig struct { URL string `json:"url"` ModifiedTime int `json:"mtime"` TileURL string `json:"tile_url"` TileSize uint `json:"tile_size"` TileZoom int `json:"tile_zoom"` ViewURL string `json:"view_url"` ImageFormat string `json:"image_format"` ImageWidth uint `json:"image_width"` ImageHeight uint `json:"image_height"` }
type ImageResponse ¶
type ImageResponse struct { Name string Config ImageConfig }
type IndexImage ¶
type IndexImage struct { IndexItem // contains filtered or unexported fields }
func (IndexImage) ImageURL ¶
func (item IndexImage) ImageURL() string
type IndexResponse ¶
type IndexResponse struct { Name string Title string Breadcrumb []IndexItem Images []IndexImage }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleImage ¶
func (*Server) HandleImageTile ¶
func (*Server) HandleIndex ¶
Click to show internal directories.
Click to hide internal directories.