gmitohtml

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package gmitohtml converts Gemini pages to HTML.

Index

Constants

View Source
const StyleCSS = `` /* 7465-byte string literal not displayed */

StyleCSS specifies page styling.

Variables

View Source
var Config = &AppConfig{
	Bookmarks: make(map[string]string),

	Certs: make(map[string]*CertConfig),
}
View Source
var ErrInvalidCertificate = errors.New("invalid certificate")

ErrInvalidCertificate is the error returned when an invalid certificate is provided.

View Source
var ErrInvalidURL = errors.New("invalid URL")

ErrInvalidURL is the error returned when the URL is invalid.

Functions

func AddBookmark

func AddBookmark(u string, label string)

AddBookmark adds a bookmark.

func Convert

func Convert(page []byte, u string) []byte

Convert converts text/gemini to text/html.

func GetBookmarks

func GetBookmarks() map[string]string

GetBookmarks returns all bookmarks.

func LastRequestTime

func LastRequestTime() int64

LastRequestTime returns the time of the last request.

func RemoveBookmark

func RemoveBookmark(u string)

RemoveBookmark removes a bookmark.

func SetClientCertificate

func SetClientCertificate(domain string, certificate []byte, privateKey []byte) error

SetClientCertificate sets the client certificate to use for a domain.

func SetOnBookmarksChanged

func SetOnBookmarksChanged(f func())

SetOnBookmarksChanged sets the function called when a bookmark is changed.

func StartDaemon

func StartDaemon(address string, hostname string, allowFile bool) error

StartDaemon starts the page conversion daemon.

Types

type AppConfig added in v1.0.5

type AppConfig struct {
	Bookmarks map[string]string

	// Convert image links to images instead of normal links
	ConvertImages bool

	Certs map[string]*CertConfig
}

type CertConfig added in v1.0.5

type CertConfig struct {
	Cert string
	Key  string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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