Module geminic

geminic - A Gemini protocol client library.

Copyright © ( C ) 2021, agmadi

Behaviours: gen_server.

Authors: agmadi.

Description

geminic - A Gemini protocol client library.

Data Types

clientcert()

clientcert() = {{certfile, string()}, {keyfile, string()}} | undefined

option()

option() = {autoredirect, true | false} | {clientcert, clientcert()}

optionlist()

optionlist() = [option()]

returnheader()

returnheader() = {Code::string(), Meta::string()}

returnresult()

returnresult() = {returnheader(), Result::string()}

Function Index

gather_links/1Gather all links present in the result.
generate_outline/1Generate an outline using heading markers in the result.
getopt/1Get an option.
getopts/0Get all options.
make_cert/2Create a certificate tuple to be used by setopt.
request/1Send a request with default timeout of 30 seconds.
request/2Send a request with specific timeout.
setopt/2Set an option.
start_link/0 Starts the server.

Function Details

gather_links/1

gather_links(Result::returnresult()) -> [string()]

returns: A list of strings containing any links from the result.

Gather all links present in the result

generate_outline/1

generate_outline(Result::returnresult()) -> [string()]

returns: A list of strings containing any headers from the result.

Generate an outline using heading markers in the result

getopt/1

getopt(Opt::term()) -> option() | error

Opt: The key for the option to get

returns: The value of the option or the atom 'error' if not found

Get an option

getopts/0

getopts() -> optionlist()

returns: The complete options list with all settings

Get all options

make_cert/2

make_cert(CertFile::string(), KeyFile::string()) -> clientcert()

CertFile: The file containing the certificate.
KeyFile: The file containin the private key.

returns: A tuple that can be used by setopt to set the clientcert option.

Create a certificate tuple to be used by setopt.

request/1

request(URI::string()) -> returnresult() | {error, Reason::term()}

URI: The full URI requested, including the protocol.

returns: A tuple of { Header, Body } or { error, Reason }

Send a request with default timeout of 30 seconds.

request/2

request(URI::string(), Timeout::integer() | infinity) -> returnresult() | {error, Reason::term()}

URI: The full URI requested, including the protocol.
Timeout: The timeout in milliseconds or 'infinity'

returns: A tuple of { Header, Body } or { error, Reason }

Send a request with specific timeout.

setopt/2

setopt(Opt::term(), Val::term()) -> optionlist()

Opt: The key for the option to set
Val: The value for the option to set

returns: The complete options list with all settings

Set an option

start_link/0

start_link() -> {ok, Pid} | ignore | {error, Error}

Starts the server


Generated by EDoc