Files
ark/server/internal/interface/grpc/interceptors/interceptor.go
Marco Argentieri 1b0252f3e4 Migrate to Go Workspaces (#243)
* api-spec: move the api-spec to root and init go.mod

* go mod tidy

* move buf files in the root as well

* gh action for api-spec changes only

* gh action for api-spec on push and pr

* introduce go.work and remove all replaces

* solve dependencies and force btcd/btcec@v2.3.3

* go work sync

* force btcd/btcec@v2.3.3

* go mod tidy
2024-08-13 03:27:41 +02:00

24 lines
654 B
Go

package interceptors
import (
"github.com/ark-network/ark/server/pkg/macaroons"
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"google.golang.org/grpc"
)
// UnaryInterceptor returns the unary interceptor
func UnaryInterceptor(svc *macaroons.Service) grpc.ServerOption {
return grpc.UnaryInterceptor(middleware.ChainUnaryServer(
unaryLogger,
unaryMacaroonAuthHandler(svc),
))
}
// StreamInterceptor returns the stream interceptor with a logrus log
func StreamInterceptor(svc *macaroons.Service) grpc.ServerOption {
return grpc.StreamInterceptor(middleware.ChainStreamServer(
streamLogger,
streamMacaroonAuthHandler(svc),
))
}