Documentation ¶
Overview ¶
Package api contains Giesela's outward-facing API.
Index ¶
- func AttachEventID(result *client.InvokeResult, eventID *sentry.EventID)
- func CallResult(res *wamp.Result) client.InvokeResult
- func CheckUser(api *API, handler client.InvocationHandler, permissions ...rbac.Permission) client.InvocationHandler
- func ErrorResultTrace(res *client.InvokeResult, trace string)
- func InternalErrorResult(args ...interface{}) client.InvokeResult
- func InvalidArgumentResult(args ...interface{}) client.InvokeResult
- func ResultFromError(err error) client.InvokeResult
- func WAMPErrorResult(err *wamp.Error) client.InvokeResult
- func WithUserInfo(ctx context.Context, user *UserInfo) context.Context
- type API
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachEventID ¶
func AttachEventID(result *client.InvokeResult, eventID *sentry.EventID)
AttachEventID attaches a Sentry event's id to an invoke result. If the event id is nil, this function is a noop. The event id is stored in the keyword argument "event_id".
func CallResult ¶
func CallResult(res *wamp.Result) client.InvokeResult
func CheckUser ¶
func CheckUser(api *API, handler client.InvocationHandler, permissions ...rbac.Permission) client.InvocationHandler
func ErrorResultTrace ¶
func ErrorResultTrace(res *client.InvokeResult, trace string)
func InternalErrorResult ¶
func InternalErrorResult(args ...interface{}) client.InvokeResult
InternalErrorResult creates an invoke result representing an internal error.
func InvalidArgumentResult ¶
func InvalidArgumentResult(args ...interface{}) client.InvokeResult
func ResultFromError ¶
func ResultFromError(err error) client.InvokeResult
ResultFromError creates an invoke result from an error. Passing a nil error will cause the function to panic. If the error is not recognised, an internal error result is created and the error is reported to Sentry.
func WAMPErrorResult ¶
func WAMPErrorResult(err *wamp.Error) client.InvokeResult
WAMPErrorResult creates an invoke result representing a WAMP error.
Types ¶
type UserInfo ¶
func UserInfoFromContextMust ¶
Click to show internal directories.
Click to hide internal directories.