Documentation
¶
Overview ¶
the package web contains the web-related stuff, i.e. all handlers the routing "table" and loads of functions for rendering the views and interacting with the database
Index ¶
- Constants
- func AdminAuthHandler(ctx echo.Context) error
- func AdminAuthInstanceHandler(ctx echo.Context) error
- func AdminAuthInstanceNewHandler(ctx echo.Context) error
- func AdminInfoHandler(ctx echo.Context) error
- func ApiTokenFromSession(u *core.User, ctx echo.Context) bool
- func BuildStatus(s string) template.HTML
- func CalcBuildDuration(b []core.Build)
- func ChangeLoginToken(ctx echo.Context, u core.User, nextStep string, stepExtra string) bool
- func CollectCookie(ctx echo.Context, name string) *http.Cookie
- func CookieExists(ctx echo.Context, name string) bool
- func GenerateLoginToken(try int) string
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func HTTPError(code int, ctx echo.Context) error
- func NewAPIToken(l *core.LoginToken, ctx echo.Context, u core.User, name string) bool
- func NewLoginToken(l *core.LoginToken, ctx echo.Context, u core.User, nextStep string, ...) bool
- func ReadCookie(ctx echo.Context, name string) (string, error)
- func RemoveCookie(ctx echo.Context, name string)
- func RemoveLoginToken(ctx echo.Context)
- func RenderTime(t time.Time) string
- func SecretCheck(data io.Reader, secret string, theirs string, method string) bool
- func UserFromIncompleteSession(u *core.User, ctx echo.Context) bool
- func UserFromSession(u *core.User, ctx echo.Context) bool
- func WebHookLogDetailHandler(ctx echo.Context) error
- func WebHookLogHandler(ctx echo.Context) error
- func WriteCookie(ctx echo.Context, name string, value string, expires time.Time)
- type Server
Constants ¶
const STATE_FAILED string = "static/img/build_failed.png"
const STATE_MISSED string = "static/img/build_miss.png"
const STATE_PASSED string = "static/img/build_passed.png"
/repo/state/:id return a corresponding image for README files of projects only when the repo is public
Variables ¶
This section is empty.
Functions ¶
func AdminAuthHandler ¶
func AdminAuthHandler(ctx echo.Context) error
/admin/auth list all authentication modules
func AdminAuthInstanceHandler ¶
func AdminAuthInstanceHandler(ctx echo.Context) error
/admin/auth/instance/:id TODO
func AdminAuthInstanceNewHandler ¶
func AdminAuthInstanceNewHandler(ctx echo.Context) error
/admin/auth/instance/new/:name TODO
func AdminInfoHandler ¶
func AdminInfoHandler(ctx echo.Context) error
/admin/info prints some information about the mvoCI server and its dependencies
func ApiTokenFromSession ¶
check that the API token exists
func BuildStatus ¶
Returns html-code for the build-status of a repo
func CalcBuildDuration ¶
calculate the duration of a build from finish and start-time
func ChangeLoginToken ¶
update the loginToken to the nextStep, set its extra, generate a new tokenstring and write it to the user
func CollectCookie ¶
return the http.Cookie for a name or nil if it doesn't exist
func CookieExists ¶
return whether a cookie exists
func GenerateLoginToken ¶
try to generate a collision free login token
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func NewAPIToken ¶
generate a new api token from the users settings page
func NewLoginToken ¶
func NewLoginToken(l *core.LoginToken, ctx echo.Context, u core.User, nextStep string, stepExtra string) bool
create a new login token for a given user with nextstep and auth extra
func ReadCookie ¶
return the content of a cookie
func RemoveCookie ¶
func RemoveCookie(ctx echo.Context, name string)
remove a cookie from the end users browser
func SecretCheck ¶
check the secret based on hmac function method
func UserFromIncompleteSession ¶
check that the user token is incomplete and exists
func UserFromSession ¶
check that the user is fully logged in using her cookie
func WebHookLogDetailHandler ¶
func WebHookLogDetailHandler(ctx echo.Context) error
admin/webhooklog/detail/:id renders a given webhook event with the response and request
func WebHookLogHandler ¶
func WebHookLogHandler(ctx echo.Context) error
/admin/webhooklog and /admin/webhooklog/:repoid renders a listing of the received webhook events