mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
27 lines
504 B
Go
27 lines
504 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"google.golang.org/grpc"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/errors"
|
||
|
)
|
||
|
|
||
|
func emptyMockHandler(_ context.Context, req interface{}) (interface{}, error) {
|
||
|
return req, nil
|
||
|
}
|
||
|
|
||
|
func errorMockHandler(_ context.Context, req interface{}) (interface{}, error) {
|
||
|
return nil, errors.ThrowInternal(nil, "test", "error")
|
||
|
}
|
||
|
|
||
|
type mockReq struct{}
|
||
|
|
||
|
func mockInfo(path string) *grpc.UnaryServerInfo {
|
||
|
return &grpc.UnaryServerInfo{
|
||
|
Server: nil,
|
||
|
FullMethod: path,
|
||
|
}
|
||
|
}
|