-
Notifications
You must be signed in to change notification settings - Fork 0
/
private.go
37 lines (28 loc) · 1000 Bytes
/
private.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package handler
import (
"fmt"
"net/http"
"google.golang.org/grpc"
)
func (m *Microservice) privateExtended() error {
clientOpts := m.baseCfg.GetClientDialOption()
clientUnaryHandlers := m.baseCfg.GetClientUnaryInterceptor()
clientStreamHandlers := m.baseCfg.GetClientStreamInterceptor()
m.client.UseDialOption(clientOpts...).
UseUnaryInterceptor(clientUnaryHandlers...).
UseStreamInterceptor(clientStreamHandlers...)
m.server.UseServerOption(m.baseCfg.GetUnaryInterceptor(m.privateUnaryServerInterceptor()...),
m.baseCfg.GetStreamInterceptor(m.privateStreamServerInterceptor()...))
return nil
}
func (m *Microservice) privateUnaryServerInterceptor() []grpc.UnaryServerInterceptor {
return nil
}
func (m *Microservice) privateStreamServerInterceptor() []grpc.StreamServerInterceptor {
return nil
}
func (m *Microservice) privateHTTPHandle(mux *http.ServeMux) {
mux.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
_, _ = fmt.Fprintf(w, "")
})
}