Documentation
¶
Index ¶
- Variables
- func CanAddRole(user *models.User, roleId constants.RoleID, facilityId constants.FacilityID) bool
- func CanEditFacility(user *models.User, facility constants.FacilityID) bool
- func ErrConflict(err error) render.Renderer
- func ErrInternalServerWithErr(err error) render.Renderer
- func ErrInvalidRequest(err error) render.Renderer
- func ErrRender(err error) render.Renderer
- func GetActionLogCtx(r *http.Request) *models.ActionLogEntry
- func GetDisciplinaryLogCtx(r *http.Request) *models.DisciplinaryLogEntry
- func GetDocumentCtx(r *http.Request) *models.Document
- func GetEventCtx(r *http.Request) *models.Event
- func GetEventPositionCtx(r *http.Request) *models.EventPosition
- func GetEventRoutingCtx(r *http.Request) *models.EventRouting
- func GetEventSignupCtx(r *http.Request) *models.EventSignup
- func GetEventTemplateCtx(r *http.Request) *models.EventTemplate
- func GetFAQCtx(r *http.Request) *models.FAQ
- func GetFacilityCtx(r *http.Request) *models.Facility
- func GetFacilityLogCtx(r *http.Request) *models.FacilityLogEntry
- func GetFeedbackCtx(r *http.Request) *models.Feedback
- func GetNewsCtx(r *http.Request) *models.News
- func GetNotificationCtx(r *http.Request) *models.Notification
- func GetRatingChangeCtx(r *http.Request) *models.RatingChange
- func GetRosterCtx(r *http.Request) *models.Roster
- func GetRosterRequestCtx(r *http.Request) *models.RosterRequest
- func GetUserCtx(r *http.Request) *models.User
- func GetUserFlagCtx(r *http.Request) *models.UserFlag
- func GetUserNotificationCtx(r *http.Request) *models.UserNotification
- func GetUserRoleCtx(r *http.Request) *models.UserRole
- func GetXFacility(r *http.Request) *models.Facility
- func GetXGuest(r *http.Request) bool
- func GetXUser(r *http.Request) *models.User
- func IsFacilityEventsStaff(user *models.User, facility constants.FacilityID) bool
- func IsFacilitySeniorStaff(user *models.User, facility constants.FacilityID) bool
- func IsFacilityStaff(user *models.User, facility constants.FacilityID) bool
- func IsInstructor(user *models.User, facility constants.FacilityID) bool
- func IsSeniorStaff(user *models.User) bool
- func IsVATUSAStaff(user *models.User) bool
- func JSON(w http.ResponseWriter, r *http.Request, code int, data interface{})
- func Pprint(obj interface{})
- func Render(w http.ResponseWriter, r *http.Request, renderer render.Renderer)
- func Response(r *http.Request, code int)
- func TempRedirect(w http.ResponseWriter, r *http.Request, location string)
- type AleKey
- type DleKey
- type DocumentKey
- type ErrResponse
- type EventKey
- type EventPositionKey
- type EventRoutingKey
- type EventSignupKey
- type EventTemplateKey
- type FAQKey
- type FacilityKey
- type FacilityLogKey
- type FeedbackKey
- type NewsKey
- type NotificationKey
- type RatingChangeKey
- type RosterKey
- type RosterRequestKey
- type UserFlagKey
- type UserKey
- type UserNotificationKey
- type UserRoleKey
- type XFacility
- type XGuest
- type XUser
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = &ErrResponse{HTTPStatusCode: 404, StatusText: "Resource not found."} ErrBadRequest = &ErrResponse{HTTPStatusCode: 400, StatusText: "Bad request"} ErrInternalServer = &ErrResponse{HTTPStatusCode: 500, StatusText: "Internal Server Error"} ErrForbidden = &ErrResponse{HTTPStatusCode: 403, StatusText: "Forbidden"} ErrInvalidFacility = &ErrResponse{HTTPStatusCode: 400, StatusText: "Invalid facility"} ErrInvalidRole = &ErrResponse{HTTPStatusCode: 400, StatusText: "Invalid role"} ErrInvalidCID = &ErrResponse{HTTPStatusCode: 400, StatusText: "Invalid CID"} )
Functions ¶
func CanAddRole ¶
func CanEditFacility ¶
func CanEditFacility(user *models.User, facility constants.FacilityID) bool
func ErrConflict ¶
func ErrInvalidRequest ¶
func GetActionLogCtx ¶
func GetActionLogCtx(r *http.Request) *models.ActionLogEntry
func GetDisciplinaryLogCtx ¶
func GetDisciplinaryLogCtx(r *http.Request) *models.DisciplinaryLogEntry
func GetEventPositionCtx ¶
func GetEventPositionCtx(r *http.Request) *models.EventPosition
func GetEventRoutingCtx ¶
func GetEventRoutingCtx(r *http.Request) *models.EventRouting
func GetEventSignupCtx ¶
func GetEventSignupCtx(r *http.Request) *models.EventSignup
func GetEventTemplateCtx ¶
func GetEventTemplateCtx(r *http.Request) *models.EventTemplate
func GetFacilityLogCtx ¶
func GetFacilityLogCtx(r *http.Request) *models.FacilityLogEntry
func GetNotificationCtx ¶
func GetNotificationCtx(r *http.Request) *models.Notification
func GetRatingChangeCtx ¶
func GetRatingChangeCtx(r *http.Request) *models.RatingChange
func GetRosterRequestCtx ¶
func GetRosterRequestCtx(r *http.Request) *models.RosterRequest
func GetUserNotificationCtx ¶
func GetUserNotificationCtx(r *http.Request) *models.UserNotification
func IsFacilityEventsStaff ¶
func IsFacilityEventsStaff(user *models.User, facility constants.FacilityID) bool
func IsFacilitySeniorStaff ¶
func IsFacilitySeniorStaff(user *models.User, facility constants.FacilityID) bool
func IsFacilityStaff ¶
func IsFacilityStaff(user *models.User, facility constants.FacilityID) bool
func IsInstructor ¶
func IsInstructor(user *models.User, facility constants.FacilityID) bool
func IsSeniorStaff ¶
func IsVATUSAStaff ¶
func TempRedirect ¶
func TempRedirect(w http.ResponseWriter, r *http.Request, location string)
Types ¶
type DocumentKey ¶
type DocumentKey struct{}
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
type EventPositionKey ¶
type EventPositionKey struct{}
type EventRoutingKey ¶
type EventRoutingKey struct{}
type EventSignupKey ¶
type EventSignupKey struct{}
type EventTemplateKey ¶
type EventTemplateKey struct{}
type FacilityKey ¶
type FacilityKey struct{}
type FacilityLogKey ¶
type FacilityLogKey struct{}
type FeedbackKey ¶
type FeedbackKey struct{}
type NotificationKey ¶
type NotificationKey struct{}
type RatingChangeKey ¶
type RatingChangeKey struct{}
type RosterRequestKey ¶
type RosterRequestKey struct{}
type UserFlagKey ¶
type UserFlagKey struct{}
type UserNotificationKey ¶
type UserNotificationKey struct{}
type UserRoleKey ¶
type UserRoleKey struct{}
Click to show internal directories.
Click to hide internal directories.