mirror of
https://github.com/h44z/wg-portal
synced 2025-02-26 05:49:14 +00:00
Public REST API implementation to handle peers, interfaces and users. It also includes some simple provisioning endpoints. The Swagger API documentation is available under /api/v1/doc.html
22 lines
525 B
Go
22 lines
525 B
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
"runtime"
|
|
)
|
|
|
|
var ErrNotFound = errors.New("record not found")
|
|
var ErrNotUnique = errors.New("record not unique")
|
|
var ErrNoPermission = errors.New("no permission")
|
|
var ErrDuplicateEntry = errors.New("duplicate entry")
|
|
var ErrInvalidData = errors.New("invalid data")
|
|
|
|
// GetStackTrace returns a stack trace of the current goroutine. The stack trace has at most 1024 bytes.
|
|
func GetStackTrace() string {
|
|
b := make([]byte, 1024)
|
|
n := runtime.Stack(b, false)
|
|
s := string(b[:n])
|
|
|
|
return s
|
|
}
|