forked from TheZeroSlave/zapsentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactory.go
More file actions
24 lines (20 loc) · 649 Bytes
/
Copy pathfactory.go
File metadata and controls
24 lines (20 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package zapsentry
import (
"github.com/getsentry/sentry-go"
)
// NewSentryClientFromDSN creates new sentry client from DSN value
func NewSentryClientFromDSN(DSN string) SentryClientFactory {
return func() (*sentry.Client, error) {
return sentry.NewClient(sentry.ClientOptions{
Dsn: DSN,
})
}
}
// NewSentryClientFromClient creates new sentry client from sentry client reference
func NewSentryClientFromClient(client *sentry.Client) SentryClientFactory {
return func() (*sentry.Client, error) {
return client, nil
}
}
// SentryClientFactory function that return sentry client
type SentryClientFactory func() (*sentry.Client, error)