Documentation
¶
Index ¶
- Constants
- func LazyRequest(url string) (result string, err error)
- func NewHandler() *pathHandler
- func ParseURL(rawUrl string) (uri, hostname, path, param string)
- type GeminiBody
- type GeminiPeer
- func (peer *GeminiPeer) GetAddr() string
- func (peer *GeminiPeer) GetParam() (string, bool)
- func (peer *GeminiPeer) Kill()
- func (peer *GeminiPeer) Read(p []byte) int
- func (peer *GeminiPeer) SendBody(body *GeminiBody)
- func (peer *GeminiPeer) SendError(meta string)
- func (peer *GeminiPeer) SendInput(meta string)
- func (peer *GeminiPeer) Write(p []byte)
- type GeminiRequest
- type GeminiServer
Constants ¶
View Source
const ( StatusInput = 10 StatusSuccess = 20 StatusRedirect = 30 StatusRedirectTemp = 30 StatusRedirectPerm = 31 StatusTemporaryFailure = 40 StatusPermanentFailure = 50 StatusNotFound = 51 StatusBadRequest = 59 StatusClientCertRequired = 60 )
Variables ¶
This section is empty.
Functions ¶
func LazyRequest ¶
func NewHandler ¶
func NewHandler() *pathHandler
Types ¶
type GeminiBody ¶
type GeminiBody struct {
// contains filtered or unexported fields
}
func NewBody ¶
func NewBody() *GeminiBody
func (*GeminiBody) AddHeader ¶
func (body *GeminiBody) AddHeader(str string)
func (*GeminiBody) AddLinkLine ¶
func (body *GeminiBody) AddLinkLine(url, text string)
func (*GeminiBody) AddRaw ¶
func (body *GeminiBody) AddRaw(data string)
func (*GeminiBody) AddTextLine ¶
func (body *GeminiBody) AddTextLine(str string)
type GeminiPeer ¶
type GeminiPeer struct {
// contains filtered or unexported fields
}
func (*GeminiPeer) GetAddr ¶
func (peer *GeminiPeer) GetAddr() string
func (*GeminiPeer) GetParam ¶
func (peer *GeminiPeer) GetParam() (string, bool)
returns (param, isParam). if isParam is false, the peer did not post any parameter data
func (*GeminiPeer) Kill ¶
func (peer *GeminiPeer) Kill()
func (*GeminiPeer) Read ¶
func (peer *GeminiPeer) Read(p []byte) int
returns number of bytes read into p (can panic!)
func (*GeminiPeer) SendBody ¶
func (peer *GeminiPeer) SendBody(body *GeminiBody)
sends a StatusSuccess response header and the body (can panic !)
func (*GeminiPeer) SendError ¶
func (peer *GeminiPeer) SendError(meta string)
meta is the text that is reported to the user (can panic !)
func (*GeminiPeer) SendInput ¶
func (peer *GeminiPeer) SendInput(meta string)
meta is the text that is prompted for the user (can panic !)
func (*GeminiPeer) Write ¶
func (peer *GeminiPeer) Write(p []byte)
writes bytes to tls connection (can panic !)
type GeminiRequest ¶
type GeminiRequest struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(uri, hostname, port, path, param string) (req *GeminiRequest, err error)
make a gemini request
func (*GeminiRequest) Read ¶
func (req *GeminiRequest) Read(p []byte) int
simple wrapper to read raw data over the tls connection
func (*GeminiRequest) Write ¶
func (req *GeminiRequest) Write(p []byte)
simple wrapper to write raw data over the tls connection (can panic !)
type GeminiServer ¶
type GeminiServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(port, certFile, keyFile string) (*GeminiServer, error)
func (*GeminiServer) Run ¶
func (server *GeminiServer) Run(peerRequest func(peer *GeminiPeer))
Click to show internal directories.
Click to hide internal directories.