Documentation ¶
Index ¶
- Constants
- Variables
- func ServeAndListen(address string, handler Handler, certFile string, keyFile string) error
- type Cert
- type Ctx
- func (ctx *Ctx) Cert() *Cert
- func (ctx *Ctx) Connection() *tls.Conn
- func (ctx *Ctx) Local(key string) any
- func (ctx *Ctx) LookupParam(key string) (string, bool)
- func (ctx *Ctx) Param(key string) string
- func (ctx *Ctx) Query() string
- func (ctx *Ctx) SendStatus(status int, info string) error
- func (ctx *Ctx) SetLocal(key string, value any)
- func (ctx *Ctx) Status(status int, info string)
- func (ctx *Ctx) URL() URL
- func (ctx *Ctx) Write(buffer []byte) (int, error)
- type Error
- type Handler
- type Map
- type Mux
- type URL
Constants ¶
View Source
const ( StatusInput = 10 StatusSensitiveInput = 11 StatusSuccess = 20 StautsTemporaryRedirection = 30 StatusPermanentRedirection = 31 StatusTemporaryFailure = 40 StautsCGIError = 42 StautsProxyError = 43 StautsSlowDown = 44 StatusPermanentFailure = 50 StatusNotFound = 51 StatusGone = 52 StatusProxyRequestRefused = 53 StatusBadRequest = 59 StatusClientCert = 60 StatusClientCertNotAuthorized = 61 StatusClientCertNotValid = 62 )
Variables ¶
View Source
var (
NotFoundErr = NewError(StatusNotFound, "not found")
)
Functions ¶
Types ¶
type Cert ¶
type Cert struct {
// contains filtered or unexported fields
}
A client certificate that is sent to the server.
func (*Cert) Fingerprint ¶
Calculates the SHA512 sum of the certificate and encodes it in hex.
func (*Cert) RawCert ¶
func (cert *Cert) RawCert() *x509.Certificate
Returns the underlying x509 certificate.
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func (*Ctx) LookupParam ¶
Lookup a route parameter.
func (*Ctx) SendStatus ¶
Sends the status to the client. If the status has already been sent, it will error. If the status isn't between [10; 99], it will error.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.