Skip to content

Commit

Permalink
Bug fix in RK TV
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxuny committed Nov 26, 2021
1 parent 29940d2 commit 560cc44
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion boot/assets/tv/apis.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
<ol class="breadcrumb">
<li><a href="/v1/rk/tv/application"><span>Application</span></a></li>
<li><a href="/rk/v1/tv/application"><span>Application</span></a></li>
<li>/</li>
<li><span itemprop="name">API</span></li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion boot/assets/tv/deps.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
<ol class="breadcrumb">
<li><a href="/v1/rk/tv/application"><span>Application</span></a></li>
<li><a href="/rk/v1/tv/application"><span>Application</span></a></li>
<li>/</li>
<li><span itemprop="name">Dependency</span></li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion boot/assets/tv/error-mapping.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
<ol class="breadcrumb">
<li><a href="/v1/rk/tv/application"><span>Application</span></a></li>
<li><a href="/rk/v1/tv/application"><span>Application</span></a></li>
<li>/</li>
<li><span itemprop="name">Error Mapping</span></li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion boot/assets/tv/js/marked.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion boot/assets/tv/license.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
<ol class="breadcrumb">
<li><a href="/v1/rk/tv/application"><span>Application</span></a></li>
<li><a href="/rk/v1/tv/application"><span>Application</span></a></li>
<li>/</li>
<li><span itemprop="name">License</span></li>
</ol>
Expand Down
4 changes: 2 additions & 2 deletions boot/assets/tv/overview.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div>
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
<ol class="breadcrumb">
<li><a href="/v1/rk/tv/application"><span>Application</span></a></li>
<li><a href="/rk/v1/tv/application"><span>Application</span></a></li>
<li>/</li>
<li><span itemprop="name">Readme</span></li>
</ol>
Expand All @@ -32,7 +32,7 @@
<div class="highlight" id="readme">
<script>
document.getElementById('readme').innerHTML =
marked('{{ .Readme }}');
marked.parse('{{ .Readme }}');
</script>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions boot/echo_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,6 @@ func RegisterEchoEntry(opts ...EchoEntryOption) *EchoEntry {
entry.Echo.HideBanner = true
}

// Default interceptor should be at front
entry.Echo.Use(entry.Interceptors...)

rkentry.GlobalAppCtx.AddEntry(entry)

return entry
Expand Down Expand Up @@ -730,6 +727,9 @@ func (entry *EchoEntry) Bootstrap(ctx context.Context) {
entry.TvEntry.Bootstrap(ctx)
}

// Default interceptor should be at front
entry.Echo.Use(entry.Interceptors...)

logger.Info("Bootstrapping EchoEntry.", event.ListPayloads()...)
go func(echoEntry *EchoEntry) {
if entry.Echo != nil {
Expand Down
2 changes: 1 addition & 1 deletion boot/pkged.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/interceptor/log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ As soon as user function returns, interceptor will write the event into files.

| Name | Default | Description |
| ---- | ---- | ---- |
| WithEntryNameAndType(entryName, entryType string) | entryName=grpc, entryType=grpc | entryName and entryType will be used to distinguish options if there are multiple interceptors in single process. |
| WithEntryNameAndType(entryName, entryType string) | entryName=gf, entryType=gf | entryName and entryType will be used to distinguish options if there are multiple interceptors in single process. |
| WithZapLoggerEntry(zapLoggerEntry *rkentry.ZapLoggerEntry) | [rkentry.GlobalAppCtx.GetZapLoggerEntryDefault()](https://github.com/rookie-ninja/rk-entry/blob/master/entry/context.go) | Zap logger would print to stdout with console encoding type. |
| WithEventLoggerEntry(eventLoggerEntry *rkentry.EventLoggerEntry) | [rkentry.GlobalAppCtx.GetEventLoggerEntryDefault()](https://github.com/rookie-ninja/rk-entry/blob/master/entry/context.go) | Event logger would print to stdout with console encoding type. |
| WithZapLoggerEncoding(ec int) | rkecholog.ENCODING_CONSOLE | rkecholog.ENCODING_CONSOLE and rkecholog.ENCODING_JSON are available options. |
Expand Down
4 changes: 2 additions & 2 deletions example/interceptor/meta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Meta interceptor is only available on server side. The interceptor will send bel

| Name | Description | Default Values |
| ---- | ---- | ---- |
| rkechometa.WithEntryNameAndType(entryName, entryType string) | Provide entry name and type if there are multiple meta interceptors needs to be used. | gin, gin |
| rkechometa.WithEntryNameAndType(entryName, entryType string) | Provide entry name and type if there are multiple meta interceptors needs to be used. | echo, echo |
| rkechometa.WithPrefix(prefix string) | Provide prefix of meta header | RK |

```go
Expand Down Expand Up @@ -150,7 +150,7 @@ func main() {
rkentry.GlobalAppCtx.GetAppInfoEntry().AppName = "demo-app"
rkentry.GlobalAppCtx.GetAppInfoEntry().Version = "demo-version"

// 1: Create gin server
// 1: Create echo server
server := startGreeterServer(opts...)
...
}
Expand Down
6 changes: 3 additions & 3 deletions example/interceptor/ratelimit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ import "github.com/rookie-ninja/rk-echo/interceptor/ratelimit"
## Options
| Name | Default | Description |
| ---- | ---- | ---- |
| WithEntryNameAndType(entryName, entryType string) | entryName=grpc, entryType=grpc | entryName and entryType will be used to distinguish options if there are multiple interceptors in single process. |
| WithEntryNameAndType(entryName, entryType string) | entryName=gf, entryType=gf | entryName and entryType will be used to distinguish options if there are multiple interceptors in single process. |
| WithReqPerSec(int) | int | Global rate limit per second. |
| WithReqPerSecByPath(path string, reqPerSec int) | "", 0 | Request limiter by gRPC method. |
| WithReqPerSecByPath(path string, reqPerSec int) | "", 0 | Request limiter by Restful method. |
| WithAlgorithm(algo string) | tokenBucket | Algorithm of rate limiter. |
| WithGlobalLimiter(l Limiter) | nil | Provider user defined limiter. |
| WithLimiterByPath(path string, l Limiter) | "", nil | Provider user defined limiter by gRPC method. |
| WithLimiterByPath(path string, l Limiter) | "", nil | Provider user defined limiter by Restful method. |

```go
// ********************************************
Expand Down

0 comments on commit 560cc44

Please sign in to comment.