Documentation ¶
Overview ¶
Copyright (C) 2023 Tim Bastin, l3montree UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func AccessControlMiddleware(obj accesscontrol.Object, act accesscontrol.Action) echo.MiddlewareFunc
- func GetAsset(c Context) models.Asset
- func GetAssetSlug(c Context) (string, error)
- func GetFlawID(c Context) (uuid.UUID, error)
- func GetParam(c Context, param string) string
- func GetProject(c Context) models.Project
- func GetProjectSlug(c Context) (string, error)
- func GetRBAC(c Context) accesscontrol.AccessControl
- func GetTenant(c Context) models.Org
- func InitLogger()
- func LoadConfig() error
- func Ptr[T any](t T) *T
- func SanitizeParam(s string) string
- type AuthSession
- type Context
- type DB
- type FilterQuery
- type MiddlewareFunc
- type PageInfo
- type Paged
- type Server
- type SortQuery
Constants ¶
This section is empty.
Variables ¶
var V = validator.New()
Functions ¶
func AccessControlMiddleware ¶
func AccessControlMiddleware(obj accesscontrol.Object, act accesscontrol.Action) echo.MiddlewareFunc
func GetAssetSlug ¶
func GetProject ¶
func GetProjectSlug ¶
func GetRBAC ¶
func GetRBAC(c Context) accesscontrol.AccessControl
func InitLogger ¶
func InitLogger()
InitLogger initializes the logger with a tint handler. tint is a simple logging library that allows to add colors to the log output. this is obviously not required, but it makes the logs easier to read.
func LoadConfig ¶
func LoadConfig() error
func SanitizeParam ¶
Types ¶
type AuthSession ¶
type AuthSession interface {
GetUserID() string
}
func GetSession ¶
func GetSession(ctx Context) AuthSession
type FilterQuery ¶
func GetFilterQuery ¶
func GetFilterQuery(ctx Context) []FilterQuery
func (FilterQuery) SQL ¶
func (f FilterQuery) SQL() string
type MiddlewareFunc ¶
type MiddlewareFunc = echo.MiddlewareFunc