Skip to content

Commit

Permalink
Add package-level document for api and adapter/micro package
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
  • Loading branch information
sczyh30 committed Sep 2, 2020
1 parent 5595860 commit 1a2362f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions adapter/micro/doc.go
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
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package api provides fundamental APIs of Sentinel.
package api

import (
Expand Down

0 comments on commit 1a2362f

Please sign in to comment.