You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
333 B
23 lines
333 B
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
|
|
}
|