Documentation
¶
Index ¶
- func CalculateInitialPoint(s string, opt *DrawStringOpts)
- func DrawStringWrapped(d *font.Drawer, s string, opt *DrawStringOpts)
- func LoggingMiddleware(next http.Handler) http.Handler
- func MeasureString(f font.Face, s string) (advance fixed.Int26_6)
- func RecoverMiddleware(next http.Handler) http.Handler
- type App
- type Config
- type DrawStringOpts
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateInitialPoint ¶
func CalculateInitialPoint(s string, opt *DrawStringOpts)
CalculateInitialPoint calculate starting point
func DrawStringWrapped ¶
func DrawStringWrapped(d *font.Drawer, s string, opt *DrawStringOpts)
DrawStringWrapped draw string wrapped
func LoggingMiddleware ¶
LoggingMiddleware logging
func MeasureString ¶
MeasureString returns how far dot would advance by drawing s with f.
Types ¶
type App ¶
type App struct { Config *Config KoruriBold *truetype.Font OgpPagePath string IndexPagePath string OgpPageTmpl *template.Template IndexPageTmpl *template.Template }
App ogp.app
func (*App) CreateImage ¶
func (app *App) CreateImage(w http.ResponseWriter, r *http.Request)
CreateImage create ogp image API
type Config ¶
type Config struct { BaseURL string `toml:"base_url"` APIServerPort string `toml:"api_server_port"` TLS bool `toml:"tls"` KoruriBoldFontPath string `toml:"koruri_bold_font_path"` DefaultImageWidth int `toml:"default_image_width"` DefaultImageHeight int `toml:"default_image_height"` DefaultFontSize float64 `toml:"default_font_size"` LocalDev bool `toml:"local_dev"` ServerCertPath string `toml:"server_cert_path"` ServerKeyPath string `toml:"server_key_path"` }
Config ogp.app config
Click to show internal directories.
Click to hide internal directories.