Go gemini tools provides tools for the gemini protocol.
This project is currently under development. I welcome suggestions, criticisms,
and patches.
Module structure
There are several tools that is provided with this module.
Constants for the module
Method
type
StatusCode
type
Basics for a gemini server. Create a GeminiServer with NewGeminiServer()
and
supply a Handler to process requests. Start the server with ListenAndServe("")
GeminiServer
struct
Handler
interface
Request
struct
ResponseWriter
interface
Header
type
Basics for a gemini client. Create a request with NewReq
or craft it by hand.
Requests support both gemini and titan as well as client certificates.
Request
struct
Response
struct
Routing handler for gemini servers. Create a new router with NewRouter()
. Add
routes with HandlePath()
or HandlePrefix()
. In your handler for paths, you
can capture variables with the Vars()
command. You can also create your own
custom matchers if the included path or prefix matchers don't work for you.
Route
struct
Matcher
interface
Router
struct
Create forms that are handled entirely by a single route. Context comes from
client certificates, but you have to provide the storage method. Two included
form types are sequence and smorgas.
Sequence forms is designed for a sequence of inputs. e.g. username, password.
Create a new sequence form with NewSequenceForm()
Smorgas forms is designed for use with a form page with links to each form
element. Going to the link will prompt the user for the corresponding input.
Create a new smorgas form with NewSmorgasForm()
FormData
type
FieldHandler
type
Form
struct
SequenceField
struct
SmorgasField
struct