Documentation
¶
Index ¶
- Constants
- Variables
- func CreateNKeyPair(p nkeys.PrefixByte) (nkeys.KeyPair, error)
- func FirstN(s string, n int) string
- func IntPtr(i *int) int
- func PrettyByteSize(b float64, size string) int64
- func PtrInt(i int) *int
- func PtrStr(s *string) string
- func PtrTime(t time.Time) *time.Time
- func PtrUUID(u uuid.UUID) *uuid.UUID
- func ShortPubKey(pubKey string) string
- func StrPtr(s string) *string
- func TimePtr(t *time.Time) time.Time
- func UUIDPtr(u *uuid.UUID) uuid.UUID
- type ByteSize
Constants ¶
View Source
const ( // PermissionAdmin grants all permissions on a team PermissionAdmin = authz.AuthzAction("admin") // PermissionSuperAdmin grants all permissions PermissionSuperAdmin = authz.AuthzAction("superadmin") // PermissionCreate grants the ability to create PermissionCreate = authz.AuthzAction("create") // PermissionDelete grants the ability to delete PermissionDelete = authz.AuthzAction("delete") // PermissionEdit grants the ability to edit PermissionEdit = authz.AuthzAction("edit") // PermissionView grants the ability to read PermissionView = authz.AuthzAction("view") )
View Source
const ( // RoleAdmin grants all permissions on a team RoleAdmin = authz.AuthzAction("Admin") // RoleSuperAdmin grants all permissions RoleSuperAdmin = authz.AuthzAction("Super Admin") // RoleOwner grants all permissions RoleOwner = authz.AuthzAction("Owner") // Editor grants the ability to edit RoleEditor = authz.AuthzAction("Editor") // RoleViewer grants the ability to read RoleViewer = authz.AuthzAction("Viewer") )
Variables ¶
View Source
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error { code := fiber.StatusInternalServerError message := err.Error() // retrive the custom error code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } return c.Status(code).JSON(fiber.Map{"error": message, "code": code}) }
DefaultErrorHandler is the default error handler.
Functions ¶
func CreateNKeyPair ¶
func CreateNKeyPair(p nkeys.PrefixByte) (nkeys.KeyPair, error)
CreateNKeyPair creates a new NKey pair.
func PrettyByteSize ¶ added in v0.1.24
PrettyByteSize ...
func ShortPubKey ¶ added in v0.1.24
ShortPubKey returns the first 8 characters of the public key.
Types ¶
Click to show internal directories.
Click to hide internal directories.