Documentation ¶
Index ¶
- Constants
- func CorsHandler() fiber.Handler
- func CreateLocationAuthzMiddleware(authClient *auth.Client) fiber.Handler
- func DeleteLocationAuthzMiddleware(authClient *auth.Client) fiber.Handler
- func ForbiddenJSONErrorResponse(c *fiber.Ctx) error
- func GetBearerTokenFromHeaders(c *fiber.Ctx) string
- func GetUserIDFromCtx(c *fiber.Ctx) string
- func Protect(authClient *auth.Client) fiber.Handler
- func SetUserIDOnCtx(c *fiber.Ctx, value string)
- func UnauthorizedJSONErrorResponse(c *fiber.Ctx) error
- type ErrorResponse
- type JSONErrorResponse
- type PageLimitOffset
- type Server
- func (s *Server) Cors()
- func (s *Server) CreateLocation(c *fiber.Ctx) error
- func (s *Server) DeleteLocation(c *fiber.Ctx) error
- func (s *Server) FindLocation(c *fiber.Ctx) error
- func (s *Server) FindLocations(c *fiber.Ctx) error
- func (s *Server) FindLocationsByCoordinates(c *fiber.Ctx) error
- func (s *Server) Routes()
- func (s *Server) Start()
Constants ¶
View Source
const ( DefaultLimit = 10 DefaultOffset = 0 )
Variables ¶
This section is empty.
Functions ¶
func CorsHandler ¶
func CorsHandler() fiber.Handler
func CreateLocationAuthzMiddleware ¶
Check if the user has rights to create a location
func DeleteLocationAuthzMiddleware ¶
Check if the user has rights to delete a location
func ForbiddenJSONErrorResponse ¶
func ForbiddenJSONErrorResponse(c *fiber.Ctx) error
func GetBearerTokenFromHeaders ¶
func GetBearerTokenFromHeaders(c *fiber.Ctx) string
GetBearerTokenFromHeaders retrieves the bearer token from the headers of a fiber.Ctx object.
func GetUserIDFromCtx ¶
func GetUserIDFromCtx(c *fiber.Ctx) string
func SetUserIDOnCtx ¶
func SetUserIDOnCtx(c *fiber.Ctx, value string)
func UnauthorizedJSONErrorResponse ¶
func UnauthorizedJSONErrorResponse(c *fiber.Ctx) error
Types ¶
type ErrorResponse ¶
func ValidateStruct ¶
func ValidateStruct(s interface{}) []*ErrorResponse
type JSONErrorResponse ¶
type JSONErrorResponse struct {
Message string `json:"message"`
}
type PageLimitOffset ¶
func GetPaginationQueryParams ¶
func GetPaginationQueryParams(c *fiber.Ctx) (*PageLimitOffset, error)
type Server ¶
type Server struct { Ctx context.Context App *fiber.App Config *configs.Config AuthClient *auth.Client Store store.Store }
func (*Server) CreateLocation ¶
func (*Server) DeleteLocation ¶
DeleteLocation deletes a location.
func (*Server) FindLocation ¶
FindLocation finds the location based on the provided ID.
func (*Server) FindLocations ¶
FindLocations retrieves a list of locations based on the provided query parameters.
func (*Server) FindLocationsByCoordinates ¶
FindLocationsByCoordinates finds locations by coordinates.
Click to show internal directories.
Click to hide internal directories.