Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeQueries ¶
func ToCodeStyle ¶
func ToFileStyle ¶
func ToURLStyle ¶
Types ¶
type Route ¶
type Route struct { Words []string Queries []map[string]interface{} // contains filtered or unexported fields }
func NewRoute ¶
When creating a route, we essentially move input data from the path to the queries, eg. /cars/:id becomes /cars?id=:id and expanding the flattened query params, eg. /cars/comments?make=bmw&1date=today becomes /cars?make=bmw /comments?date=today
func (*Route) EncodeQueries ¶
type Sentence ¶
type Sentence struct {
Noun, Verb, Redundant string
}
func NewSentence ¶
The construction of a sentence consists of analyzing parts of the route with the help of a speaker, who can recognize nouns, and verbs related to that noun.
Rethink later: there can be a certain ambivalence in the way the nouns (subjects) determine the location for a verb. Eg (retard example): /users/posts/whatevers/delete-everything => The verb "DeleteEverything" is not related only to "whatevers", but rather it is a standalone method acting on arguments...
type URLEncoder ¶
type URLEncoder struct {
// contains filtered or unexported fields
}
func NewURLEncoder ¶
func NewURLEncoder(r *Route, s *Sentence) *URLEncoder
func (*URLEncoder) Form ¶
func (u *URLEncoder) Form(action_name string) *Form