util

package
v0.0.0-...-7fd5faa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const OrganisationIDKey ctxKeyOrganisationID = 0

OrganisationIDKey is the key that holds the unique Organisation ID in a request context.

View Source
const UserIDKey ctxKeyUserID = 0

UserIDKey is the key that holds the unique user ID in a request context.

Variables

This section is empty.

Functions

func CheckOrganisation

func CheckOrganisation(h http.Handler) http.Handler

CheckOrganisation check X-Organisation in header

func CheckSuperOrganisation

func CheckSuperOrganisation(h http.Handler) http.Handler

CheckSuperOrganisation checks weather organisation of user is super org or not

func CheckUser

func CheckUser(h http.Handler) http.Handler

CheckUser check X-User in header

func GetOrganisation

func GetOrganisation(ctx context.Context) (int, error)

GetOrganisation return Organisation ID

func GetRequest

func GetRequest(url string) error

GetRequest returns error if error in status code

func GetSuperOrganisationID

func GetSuperOrganisationID() (int, error)

GetSuperOrganisationID get superorganisation id from keto policy

func GetUser

func GetUser(ctx context.Context) (int, error)

GetUser return user ID

func GormRequestID

func GormRequestID(h http.Handler) http.Handler

GormRequestID returns middleware to add request_id in gorm context

func KavachChecker

func KavachChecker() error

KavachChecker checks if Kavach is ready

func KetoChecker

func KetoChecker() error

KetoChecker checks if keto is ready

func KratosChecker

func KratosChecker() error

KratosChecker checks if Kratos is ready

func MeiliChecker

func MeiliChecker() error

MeiliChecker checks if Meilisearch is ready

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL