Initial client server connection using TLS
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package gemini
|
||||
|
||||
import "strings"
|
||||
|
||||
type Request struct {
|
||||
Host string
|
||||
Port string
|
||||
Path string
|
||||
Schema string
|
||||
}
|
||||
|
||||
func NewRequest(url string) Request {
|
||||
r := Request{}
|
||||
var parts []string
|
||||
if strings.Contains(url, "://") {
|
||||
parts = strings.Split(url, "://")
|
||||
r.Schema = parts[0]
|
||||
} else {
|
||||
r.Schema = "gemini"
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
package gemini
|
||||
@@ -0,0 +1,22 @@
|
||||
package gemini
|
||||
|
||||
const (
|
||||
INPUT int = 10
|
||||
SENSITIVE_INPUT int = 11
|
||||
SUCCESS int = 20
|
||||
TEMPORARY_REDIRECT int = 30
|
||||
PERMANENT_REDIRECT int = 31
|
||||
TEMPORARY_FAILURE int = 40
|
||||
SERVER_UNAVAILABLE int = 41
|
||||
CGI_ERROR int = 42
|
||||
PROXY_ERROR int = 43
|
||||
SLOW_DOWN int = 44
|
||||
PERMANENT_FALIURE int = 50
|
||||
NOT_FOUND int = 51
|
||||
GONE int = 52
|
||||
PROXY_REQUEST_REFUSED int = 53
|
||||
BAD_REQUEST int = 59
|
||||
CLIENT_CERTIFICATE_REQUIRED int = 60
|
||||
CERTIFICATE_NOT_AUTHORIZED int = 61
|
||||
CERTIFICATE_NOT_VALID int = 62
|
||||
)
|
||||
Reference in New Issue
Block a user