Documentation ¶
Overview ¶
Package pageview implements a web page link preview.
Copyright © 2019 M.Watermann, 10247 Berlin, Germany All rights reserved EMail : <support@mwat.de>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the GNU General Public License along with this program. If not, see the [GNU General Public License](http://www.gnu.org/licenses/gpl.html) for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDirectory ¶
func CacheDirectory() string
CacheDirectory returns the directory to store the generated images.
func CreateImage ¶
CreateImage generates an image of `aURL` and stores it in `CacheDirectory` returning the file name of the saved image.
`aURL` The address of the web page to process.
func PathFile ¶
PathFile returns the complete local path/file of `aURL`.
NOTE: This function does not check whether the file for `aURL` actually exists in the local filesystem.
func SetCacheDirectory ¶
SetCacheDirectory sets the directory to use for storing the generated images returning an error if `aDirectory` can't be used.
`aDirectory` The directory to store the generated images.
func SetMaxAge ¶
SetMaxAge sets the maximimum age of cached page images.
Usually you want this property at its default value (`0`, zero) which disables an age check because you want an image of the page at the time you linked to it.
`aLengthInSeconds` is the age a page image can have before
requesting it again.
Types ¶
This section is empty.