Skip to content

Commit 6228308

Browse files
committed
docs: describe surf structure
1 parent 8671422 commit 6228308

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
# A SURF (Standard Unique Resource Finder) parser
22

3-
Features
3+
## Features
4+
45
- Transforming a SURF into a structured representation
56
- Resolving the domain name of the SURF host into an ip address
67

8+
## Structure
9+
10+
```
11+
grid!domain.com -> {
12+
host: "grid.domain.com" # Notice that `www` is not the default
13+
path: None,
14+
port: 2023, # idk, we need to choose a default port
15+
query: None,
16+
fragment: None
17+
}
18+
```
19+
20+
```
21+
grid!domain.com/path/to/something?param=sth#this-section -> {
22+
host: "grid.domain.com",
23+
path: ["path", "to", "something"],
24+
port: 2023, # idk, we need to choose a default port
25+
query: {
26+
param: "sth"
27+
},
28+
fragment: "the-section"
29+
}
30+
```
31+
32+
```
33+
grid! -> {
34+
host: "localhost",
35+
path: None,
36+
port: 2023,
37+
query: None,
38+
fragment: None
39+
}
40+
```

0 commit comments

Comments
 (0)