From a6a51f8981141c1cc4191996dc8dc83a9c4e10bc Mon Sep 17 00:00:00 2001 From: Zadat Olayinka Date: Fri, 3 Sep 2021 12:15:18 +0100 Subject: [PATCH] rread me update --- go-sdk/README.md | 122 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 2 deletions(-) diff --git a/go-sdk/README.md b/go-sdk/README.md index c1c2038220..73714f293c 100644 --- a/go-sdk/README.md +++ b/go-sdk/README.md @@ -150,10 +150,20 @@ Main API to send logs to the server. - [Basic Usage for Tracking](#basic-usage-for-tracking) - [API Documentation](#api-documentation) - [Init(LoggerOptions)](#initloggeroptions) - - [LoggerOptions](#loggeroptions) + - [LoggerOptions](#loggeroptions) - [LogInfo(log, tags)](#loginfolog-tags) - [LogWarning(warning, tags)](#logwarningwarning-tags) - [LogError(error, tags)](#logerrorerror-tags) + - [InitTracker(FyipeTrackerOption)](#inittrackerfyipetrackeroption) + - [FyipeTrackerOption](#fyipetrackeroption) + - [TrackerOption](#trackeroption) + - [SetTag(key, value)](#settagkey-value) + - [SetTags(tags)](#settagstags) + - [SetFingerprint(fingerprint)](#setfingerprintfingerprint) + - [AddToTimeline(category, content, type)](#addtotimelinecategory-content-type) + - [CaptureMessage(message)](#capturemessagemessage) + - [CaptureException(error)](#captureexceptionerror) + - [Contribution](#contribution) @@ -168,7 +178,7 @@ Create a constructor from the class, which will be used to send logs to the serv | ------------- | ------------------- | ----------------------------------------------- | | LoggerOptions | struct | The Object containing the Log Container details | -### LoggerOptions +#### LoggerOptions LoggerOption **Kind**: Struct @@ -215,3 +225,111 @@ Logs a request of type `error` to the server. | ----- | ------------------------------------------ | ----------------------------------------------------------- | | error | string \| Struct | The content to the logged on the server. | | tags | string \| Array | The tag(s) to be attached to the logged item on the server. | + + + +### InitTracker(FyipeTrackerOption) + +Create a constructor from the class, which will be used to track errors sent to the server. + +**Kind**: Constructor +**Returns**: Initialized Tracker + +| Param | Type | Description | +| ------------------ | ------------------- | ----------------------------------------------------------------------------- | +| FyipeTrackerOption | struct | The Object containing the Error Tracking Container details and tracker option | + +#### FyipeTrackerOption + +**Kind**: Struct +**Returns**: null + +| Param | Type | Description | +| --------------- | -------------------------- | ------------------------------------------- | +| ApiUrl | string | The Server URL. | +| ErrorTrackerId | string | The Error Tracker ID. | +| ErrorTrackerKey | string | The Error Tracker Key. | +| Option | TrackerOption | The options to be considred by the tracker. | + +#### TrackerOption + +| Param | Type | Description | +| ------------------ | -------------------- | ----------------------------------------------------------------------------------------------------- | +| MaxTimeline | int | The total amount of timeline that should be captured, defaults to 5 | +| CaptureCodeSnippet | boolean | When set as `true` stack traces are automatically attached to all error sent to your fyipe dashboard. | + +#### SetTag(key, value) + +Set tag for the error to be sent to the server. + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: null + +| Param | Type | Description | +| ----- | ------------------- | ---------------------- | +| key | string | The key for the tag. | +| value | string | The value for the tag. | + +#### SetTags(tags) + +Set multiple tags for the error to be sent to the server. Takes in a map of string of string + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: null + +| Param | Type | Description | +| ----- | ------------------------------ | -------------------- | +| tags | map[string]string | The key for the tag. | + +#### SetFingerprint(fingerprint) + +Set fingerprint for the next error to be captured. + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: null + +| Param | Type | Description | +| ----------- | ---------------------------- | ------------------------------------------------------------- | +| fingerprint | list of strings | The set of string used to group error messages on the server. | + +#### AddToTimeline(category, content, type) + +Add a custom timeline element to the next error to be sent to the server + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: null + +| Param | Type | Description | +| -------- | ------------------------------------------ | ----------------------------------- | +| category | string | The category of the timeline event. | +| content | string \| struct | The content of the timeline event. | +| type | string | The type of timeline event. | + +#### CaptureMessage(message) + +Capture a custom error message to be sent to the server + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: response + +| Param | Type | Description | +| ------- | ------------------- | ------------------------------------- | +| message | string | The message to be sent to the server. | + +#### CaptureException(error) + +Capture a custom error object to be sent to the server + +**Kind**: method of [FyipeTracker](#tracker_api--tracker) +**Returns**: response + +| Param | Type | Description | +| ----- | ------------------------- | ------------------------------------------ | +| error | Error object | The Error Object to be sent to the server. | + +## Contribution + +- Clone repository +- run `cd go-sdk` +- run `go get -d ./...` to install dependencies +- run `go test -v` to run tests