Documentation ¶
Index ¶
- Variables
- func AssociateType(leftType, rightType string) gin.HandlerFunc
- func BaseRateLimitSetup(settings kodex.Settings, endpoints *gin.RouterGroup, meter kodex.Meter)
- func CheckScopes(requiredScopes, userScopes []string) bool
- func Cors(settings kodex.Settings, defaultRoute bool) gin.HandlerFunc
- func CorsFromEverywhere(settings kodex.Settings) gin.HandlerFunc
- func IPMeterID(settings kodex.Settings) gin.HandlerFunc
- func MeterEndpointCalls(meter kodex.Meter, meterId string) func(*gin.Context)
- func Metered(settings kodex.Settings, meter kodex.Meter) gin.HandlerFunc
- func ObjectType(objectType string) gin.HandlerFunc
- func OrganizationMeterId(settings kodex.Settings) gin.HandlerFunc
- func RateLimited(meter kodex.Meter, settings kodex.Settings, idName, rateLimitName string, ...) gin.HandlerFunc
- func ValidObject(settings kodex.Settings, objectType string, objectRoles []string, ...) gin.HandlerFunc
- func ValidOrganization(orgRoles []string) gin.HandlerFunc
- func ValidUser(settings kodex.Settings, scopes []string, superUser bool) gin.HandlerFunc
- func WithController(controller api.Controller) gin.HandlerFunc
- func WithSettings(settings kodex.Settings) gin.HandlerFunc
- func WithValue(name string, value interface{}) gin.HandlerFunc
- type RateLimitType
Constants ¶
This section is empty.
Variables ¶
View Source
var CorsForm = forms.Form{ ErrorMsg: "invalid data encountered in the Cors form", Fields: []forms.Field{ { Name: "allowed-hosts", Validators: []forms.Validator{ forms.IsRequired{}, forms.IsStringList{}, }, }, { Name: "allowed-headers", Validators: []forms.Validator{ forms.IsOptional{Default: []string{}}, forms.IsStringList{}, }, }, { Name: "allowed-methods", Validators: []forms.Validator{ forms.IsOptional{Default: []string{"GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS"}}, forms.IsStringList{}, }, }, { Name: "disable", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsBoolean{}, }, }, }, }
Functions ¶
func AssociateType ¶
func AssociateType(leftType, rightType string) gin.HandlerFunc
func BaseRateLimitSetup ¶
func CheckScopes ¶
func CorsFromEverywhere ¶
func CorsFromEverywhere(settings kodex.Settings) gin.HandlerFunc
func MeterEndpointCalls ¶
func ObjectType ¶
func ObjectType(objectType string) gin.HandlerFunc
func OrganizationMeterId ¶
func OrganizationMeterId(settings kodex.Settings) gin.HandlerFunc
func RateLimited ¶
func RateLimited(meter kodex.Meter, settings kodex.Settings, idName, rateLimitName string, tw kodex.TimeWindowFunc, rateLimitType RateLimitType, max int64) gin.HandlerFunc
func ValidObject ¶
func ValidOrganization ¶
func ValidOrganization(orgRoles []string) gin.HandlerFunc
func ValidUser ¶
Makes sure that the user has provided a valid access token. Stores the token, user ID and user in the context.
func WithController ¶
func WithController(controller api.Controller) gin.HandlerFunc
func WithSettings ¶
func WithSettings(settings kodex.Settings) gin.HandlerFunc
func WithValue ¶
func WithValue(name string, value interface{}) gin.HandlerFunc
Types ¶
type RateLimitType ¶
type RateLimitType int
const ( VolumeRateLimit RateLimitType = iota CallRateLimit )
Click to show internal directories.
Click to hide internal directories.