Created
November 17, 2017 21:05
-
-
Save gmemstr/60831109f0ae6c40861c1751a367524e to your computer and use it in GitHub Desktop.
Useful Sublime snippets for Pogo development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Use this to create a new route handler function --> | |
<snippet> | |
<content><![CDATA[ | |
func ${2}() common.Handler { | |
return func(rc *common.RouterContext, w http.ResponseWriter, r *http.Request) *common.HTTPError { | |
return nil | |
} | |
} | |
]]></content> | |
<tabTrigger>nrf</tabTrigger> | |
<scope>source.go</scope> | |
<description>New router path handler</description> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Use this to create a new route in router/router.go --> | |
<snippet> | |
<content><![CDATA[ | |
r.Handle("/${2}", Handle( | |
${3}(), | |
)).Methods(${4}) | |
]]></content> | |
<tabTrigger>nrp</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.go</scope> | |
<description>New router path</description> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Use this to create a new route that requires login in router/router.go --> | |
<snippet> | |
<content><![CDATA[ | |
r.Handle("/admin/${2}", Handle( | |
auth.RequireAuthorization(), | |
admin.${3}(), | |
)).Methods(${4}) | |
]]></content> | |
<tabTrigger>nrpa</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.go</scope> | |
<description>New authenticated router path</description> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment