...

Source file src/github.com/goph/emperror/handler/airbrakehandler/handler_test.go

Documentation: github.com/goph/emperror/handler/airbrakehandler

     1  // nolint: goconst
     2  package airbrakehandler_test
     3  
     4  import (
     5  	"github.com/airbrake/gobrake"
     6  
     7  	"github.com/goph/emperror/handler/airbrakehandler"
     8  )
     9  
    10  func ExampleNew() {
    11  	projectID := int64(1)
    12  	projectKey := "key"
    13  
    14  	handler := airbrakehandler.New(projectID, projectKey)
    15  	defer handler.Close() // Make sure to close the handler to flush all error reporting in progress
    16  
    17  	// Output:
    18  }
    19  
    20  func ExampleNewFromNotifier() {
    21  	projectID := int64(1)
    22  	projectKey := "key"
    23  
    24  	notifier := gobrake.NewNotifier(projectID, projectKey)
    25  	handler := airbrakehandler.NewFromNotifier(notifier)
    26  	defer handler.Close() // Make sure to close the handler to flush all error reporting in progress
    27  
    28  	// Output:
    29  }
    30  
    31  func ExampleNewSync() {
    32  	projectID := int64(1)
    33  	projectKey := "key"
    34  
    35  	handler := airbrakehandler.NewSync(projectID, projectKey)
    36  	defer handler.Close()
    37  
    38  	// Output:
    39  }
    40  
    41  func ExampleNewSyncFromNotifier() {
    42  	projectID := int64(1)
    43  	projectKey := "key"
    44  
    45  	notifier := gobrake.NewNotifier(projectID, projectKey)
    46  	handler := airbrakehandler.NewSyncFromNotifier(notifier)
    47  	defer handler.Close()
    48  
    49  	// Output:
    50  }
    51  

View as plain text