| 123456789101112131415161718192021222324252627282930 |
- package param
- import (
- "context"
- "net/url"
- )
- func GetQuery(c context.Context) url.Values {
- query := c.Value("query")
- if _, ok := query.(url.Values); ok {
- return query.(url.Values)
- }
- return url.Values{}
- }
- func GetFromPath(c context.Context) string {
- path := c.Value("from_path")
- if _, ok := path.(string); ok {
- return path.(string)
- }
- return ""
- }
- func GetUri(c context.Context) string {
- uri := c.Value("uri")
- if _, ok := uri.(string); ok {
- return uri.(string)
- }
- return ""
- }
|