utils

package
v0.1.50 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShowTeamUrlFormat                = "/teams/%s"
	DeleteTeamUrlFormat              = "/teams/%s"
	ShowAccountUrlFormat             = "/accounts/%s"
	DeleteAccountUrlFormat           = "/accounts/%s"
	DeleteOperatorUrlFormat          = "/operators/%s"
	DeleteUserUrlFormat              = "/users/%s"
	DownloadTokenAccountUrl          = "/accounts/%s/token"
	DownloadCredentialsUserUrlFormat = "/users/%s/credentials"
)

Variables

View Source
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
	code := fiber.StatusInternalServerError
	message := err.Error()

	// retrieve 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 ShortPubKey added in v0.1.24

func ShortPubKey(pubKey string) string

ShortPubKey returns the first 8 characters of the public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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