Documentation
¶
Overview ¶
Package routecases holds the request paths that pin manifest.MatchRoute to the pages handler: the tests of web check what the handler serves at each path, and the tests of manifest check that MatchRoute names the same page.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cases = []Case{ {Folders: notes, Keys: notesKeys, Path: "/notes", Want: "/notes"}, {Folders: notes, Keys: notesKeys, Path: "/notes/12", Want: "/notes/{id}"}, {Folders: notes, Keys: notesKeys, Path: "/notes/%31%32", Want: "/notes/{id}"}, {Folders: notes, Keys: notesKeys, Path: "/notes/12/", Want: "/notes/{id}"}, {Folders: notes, Keys: notesKeys, Path: "/notes/abc"}, {Folders: notes, Keys: notesKeys, Path: "/notes/n_5"}, {Folders: notes, Keys: notesKeys, Path: "/notes/1%2F2"}, {Folders: notes, Keys: notesKeys, Path: "/notes//12"}, {Folders: notes, Keys: notesKeys, Path: "/notes/12/x"}, {Folders: tags, Keys: tagsKeys, Path: "/t/s_y", Want: "/t/{x}"}, {Folders: tags, Keys: tagsKeys, Path: "/t/s_x", Want: "/t/{x}"}, {Folders: tags, Keys: tagsKeys, Path: "/t/n_5", Want: "/t/{x}"}, {Folders: tags, Keys: tagsKeys, Path: "/t/x%2Fy"}, {Folders: tags, Keys: tagsKeys, Path: "/t"}, {Folders: ab, Keys: ab, Path: "/a/b", Want: "/a/b"}, {Folders: ab, Keys: ab, Path: "/a/b/", Want: "/a/b"}, {Folders: ab, Keys: ab, Path: "//a/b//", Want: "/a/b"}, {Folders: ab, Keys: ab, Path: "/a%2Fb", Want: "/a/b"}, {Folders: ab, Keys: ab, Path: "/a//b"}, {Folders: ab, Keys: ab, Path: "/A/b"}, {Folders: ab, Keys: ab, Path: "/a"}, {Folders: ab, Keys: ab, Path: "/"}, {Folders: users, Keys: usersKeys, Path: "/u/new", Want: "/u/new"}, {Folders: users, Keys: usersKeys, Path: "/u/bob", Want: "/u/{name}"}, {Folders: branch, Keys: branchKeys, Path: "/v/z/d", Want: "/v/{x}/d"}, {Folders: branch, Keys: branchKeys, Path: "/v/w/d"}, {Folders: []string{"/l", "/l/p"}, Keys: []string{"/l/p"}, Path: "/l"}, {Folders: []string{"/l", "/l/p"}, Keys: []string{"/l/p"}, Path: "/l/p", Want: "/l/p"}, {Folders: []string{"/m", "/m/n_id"}, Keys: []string{"/m/{id}"}, Path: "/m"}, {Folders: []string{"/m", "/m/n_id"}, Keys: []string{"/m/{id}"}, Path: "/m/7", Want: "/m/{id}"}, {Folders: []string{"/"}, Keys: []string{"/"}, Path: "/", Want: "/"}, {Folders: []string{"/", "/a"}, Keys: []string{"/", "/a"}, Path: "/a", Want: "/a"}, {Folders: []string{"/"}, Keys: []string{"/"}, Path: "/x"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book", Want: "/book", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book/__ws", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book/", Want: "/book", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book//", Want: "/book", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/%62ook", Want: "/book", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book/12", Want: "/book/{id}", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book/abc"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin", Want: "/admin"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin/x"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/__ws", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/book%2F12", Want: "/book/{id}", Public: true}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin/__ws"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin/", Want: "/admin"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/%61dmin", Want: "/admin"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin?x=/book", Want: "/admin"}, {Folders: site, Keys: siteKeys, PublicKeys: sitePublic, Layouts: siteRoot, Path: "/admin%2Fx"}, {Folders: event, Keys: eventKeys, PublicKeys: eventOpen, Layouts: siteRoot, NoRule: eventBare, Path: "/ev/signup", Want: "/ev/signup", Public: true}, {Folders: event, Keys: eventKeys, PublicKeys: eventOpen, Layouts: siteRoot, NoRule: eventBare, Path: "/ev/signup/__ws", Public: true}, {Folders: event, Keys: eventKeys, PublicKeys: eventOpen, Layouts: siteRoot, NoRule: eventBare, Path: "/ev"}, {Folders: event, Keys: eventKeys, PublicKeys: eventOpen, Layouts: siteRoot, NoRule: eventBare, Path: "/ev/__ws"}, {Folders: event, Keys: eventKeys, PublicKeys: eventOpen, Layouts: siteRoot, NoRule: eventBare, Path: "/admin", Want: "/admin"}, }
Cases are the paths every matcher of access keys must agree on with the pages handler.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct {
Folders []string
Keys []string
PublicKeys []string
Layouts []string
NoRule []string
Path string
Want string
Public bool
}
Case is one app and one request path. Folders are the app's page folders, such as /notes/n_id; Keys the access keys aicoded generate writes for them, such as /notes/{id}, where a folder without a key is a layout whose default page is its first page folder right below it that is not a parameter folder; PublicKeys the keys whose entry has public; Layouts the folders with a key that are layouts too, as a public layout is; NoRule the layouts without a key whose template has no access rule at all; Path the request target; Want the key of the page the pages handler serves at Path to a plain GET, or "" when it serves no page, such as a 404, a redirect or a live connection's path; and Public whether Path is a public path, where the pages handler takes a request without a signed-in viewer: a plain GET gets the page or its redirect, and a live connection's path takes the upgrade.