-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add package-level document for api and adapter/micro package
Signed-off-by: Eric Zhao <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
This package provides Sentinel integration for go-micro. | ||
For server side, users may append a Sentinel handler wrapper to go-micro service, like: | ||
import ( | ||
sentinelPlugin "github.com/alibaba/sentinel-golang/adapter/micro" | ||
) | ||
// Append a Sentinel handler wrapper. | ||
micro.NewService(micro.WrapHandler(sentinelPlugin.NewHandlerWrapper())) | ||
The plugin extracts service method as the resource name by default. | ||
Users may provide customized resource name extractor when creating new | ||
Sentinel handler wrapper (via options). | ||
Fallback logic: the plugin will return the BlockError by default | ||
if current request is blocked by Sentinel rules. Users may also | ||
provide customized fallback logic via WithXxxBlockFallback(handler) options. | ||
*/ | ||
package micro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Package api provides fundamental APIs of Sentinel. | ||
package api | ||
|
||
import ( | ||
|