crashtracker

package
v0.0.0-...-9cf9cea Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDryRunClient

func NewDryRunClient() (*dryRunClient, error)

func NewSentryClient

func NewSentryClient(sentryDSN string, environment string, gitCommit string) (*sentryClient, error)

NewSentryClient is a func that creates a new sentryClient using the sentryImplementation.

Types

type CrashTrackerClient

type CrashTrackerClient interface {
	LogAndReportErrors(ctx context.Context, err error, msg string)
	LogAndReportMessages(ctx context.Context, msg string)
	FlushEvents(waitTime time.Duration) bool
	Recover()
	Clone() CrashTrackerClient
}

type CrashTrackerOptions

type CrashTrackerOptions struct {
	CrashTrackerType CrashTrackerType
	Environment      string
	GitCommit        string

	// Sentry variables
	SentryDSN string
}

type CrashTrackerType

type CrashTrackerType string
const (
	// CrashTrackerTypeSentry is used to monitor errors with sentry.
	CrashTrackerTypeSentry CrashTrackerType = "SENTRY"
	// CrashTrackerTypeDryRun is used for development environment
	CrashTrackerTypeDryRun CrashTrackerType = "DRY_RUN"
)

func ParseCrashTrackerType

func ParseCrashTrackerType(messengerTypeStr string) (CrashTrackerType, error)

type MockCrashTrackerClient

type MockCrashTrackerClient struct {
	mock.Mock
}

func (*MockCrashTrackerClient) Clone

func (*MockCrashTrackerClient) FlushEvents

func (m *MockCrashTrackerClient) FlushEvents(waitTime time.Duration) bool

func (*MockCrashTrackerClient) LogAndReportErrors

func (m *MockCrashTrackerClient) LogAndReportErrors(ctx context.Context, err error, msg string)

func (*MockCrashTrackerClient) LogAndReportMessages

func (m *MockCrashTrackerClient) LogAndReportMessages(ctx context.Context, msg string)

func (*MockCrashTrackerClient) Recover

func (m *MockCrashTrackerClient) Recover()

Jump to

Keyboard shortcuts

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