Documentation
¶
Overview ¶
panic.go recovers from panics and converts them into proper gRPC errors instead of crashing the server. the panic errors are converted to INTERNAL_ERROR errors and stack traces are logged.
Index ¶
- func CheckMacaroon(ctx context.Context, fullMethod string, svc *macaroons.Service) error
- func StreamInterceptor(svc *macaroons.Service, readiness *ReadinessService, ...) grpc.ServerOption
- func UnaryInterceptor(svc *macaroons.Service, readiness *ReadinessService, ...) grpc.ServerOption
- type ReadinessService
- type VersionGuard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMacaroon ¶ added in v0.8.0
func StreamInterceptor ¶
func StreamInterceptor( svc *macaroons.Service, readiness *ReadinessService, getVersionGuard func() (*VersionGuard, error), getDigest func() (string, bool, error), ) grpc.ServerOption
StreamInterceptor returns the stream interceptor with a logrus log.
func UnaryInterceptor ¶
func UnaryInterceptor( svc *macaroons.Service, readiness *ReadinessService, getVersionGuard func() (*VersionGuard, error), getDigest func() (string, bool, error), ) grpc.ServerOption
UnaryInterceptor returns the unary interceptor.
Types ¶
type ReadinessService ¶ added in v0.9.0
type ReadinessService struct {
// contains filtered or unexported fields
}
func NewReadinessService ¶ added in v0.9.0
func NewReadinessService(ctx context.Context) *ReadinessService
func (*ReadinessService) Check ¶ added in v0.9.0
func (r *ReadinessService) Check(_ context.Context, fullMethod string) error
func (*ReadinessService) ListenToWalletState ¶ added in v0.9.1
func (r *ReadinessService) ListenToWalletState(connect func() <-chan bool)
func (*ReadinessService) MarkAppServiceStarted ¶ added in v0.9.0
func (r *ReadinessService) MarkAppServiceStarted()
func (*ReadinessService) MarkAppServiceStopped ¶ added in v0.9.0
func (r *ReadinessService) MarkAppServiceStopped()
type VersionGuard ¶ added in v0.9.9
type VersionGuard struct {
BuilldVersion string
RequireHeader bool
// contains filtered or unexported fields
}
VersionGuard holds the configuration for the build-version compatibility check. The threshold is always the server's own build version. Use NewVersionGuard to construct it: the server version is parsed once there instead of on every request.
func NewVersionGuard ¶ added in v0.9.9
func NewVersionGuard( serverVersion string, requireHeader bool, ) VersionGuard
NewVersionGuard builds a VersionGuard, pre-parsing serverVersion and pre-computing the minimum allowed client version for the given level.