Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gate ¶
type Gate interface {
WithContext(ctx context.Context) Gate
Allows(ability string, arguments map[string]any) bool
Denies(ability string, arguments map[string]any) bool
Inspect(ability string, arguments map[string]any) Response
Define(ability string, callback func(ctx context.Context, arguments map[string]any) Response)
Any(abilities []string, arguments map[string]any) bool
None(abilities []string, arguments map[string]any) bool
Before(callback func(ctx context.Context, ability string, arguments map[string]any) Response)
After(callback func(ctx context.Context, ability string, arguments map[string]any, result Response) Response)
}
type ResponseImpl ¶
type ResponseImpl struct {
// contains filtered or unexported fields
}
func (*ResponseImpl) Allowed ¶
func (r *ResponseImpl) Allowed() bool
func (*ResponseImpl) Message ¶
func (r *ResponseImpl) Message() string
Click to show internal directories.
Click to hide internal directories.