Documentation ¶
Index ¶
- func BasicAuthValidation(ctx context.Context, db *gorm.DB) error
- func GetClientIP(ctx context.Context) string
- func IsGrpcCall(ctx context.Context) bool
- func NewContext(ctx context.Context, u UserInfo) context.Context
- func NewContextForGrpcCall(ctx context.Context) context.Context
- func NewContextWithClientIP(ctx context.Context, ip string) context.Context
- func WithClaims(ctx context.Context, c map[string]interface{}) context.Context
- type UserInfo
- type ValidateUserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthValidation ¶
BasicAuthValidation It will check the user id present in context is valid or not
func GetClientIP ¶
func IsGrpcCall ¶
func NewContextWithClientIP ¶
Types ¶
type UserInfo ¶
func FromClaims ¶
func FromContext ¶
FromContext returns the User value stored in ctx, if any.
type ValidateUserInfo ¶
type ValidateUserInfo struct { Ctx context.Context RootTable interface{} RootTableTag string //Key Will be tag name Args map[string]interface{} SkipRootValidation bool SkipArgsValidation bool Db *gorm.DB // contains filtered or unexported fields }
func (*ValidateUserInfo) ValidateUser ¶
func (validateUserInfo *ValidateUserInfo) ValidateUser() error
ValidateUser Validate User : Will validate user id is present in the given table or not
Click to show internal directories.
Click to hide internal directories.