request

package
v0.0.0-...-7674232 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CtxUserId key = 1

CtxUserId is context key for getting id

View Source
const CtxUserPermission key = 2

CtxUserPermission is context key for getting permission

Variables

This section is empty.

Functions

func GetHeaders

func GetHeaders(ctx context.Context) (int32, int32, error)

GetHeaders gets requested user's permission and id from context

func GetUserID

func GetUserID(ctx context.Context) (int32, error)

GetUserID gets a requested user's id from context

func GetUserPermission

func GetUserPermission(ctx context.Context) (int32, error)

GetUserPermission gets a requested user's permission from context

func ValidatePermission

func ValidatePermission(issuerPermission int32, issuerID int32, targetID int32) error

ValidatePermission validates issuer account can change specified account

func ValidateRequiredFields

func ValidateRequiredFields(req interface{}, fields []string) error

ValidateRequiredFields validates required fields are not empty

Types

This section is empty.

Jump to

Keyboard shortcuts

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