Documentation
¶
Index ¶
- Constants
- type Option
- func WithLogger(logger *slog.Logger) Option
- func WithMaxRecvMsgSize(size int) Option
- func WithMaxSendMsgSize(size int) Option
- func WithRateLimiter(cacheEngine cache.Engine, rate int, burst int, ttl time.Duration) Option
- func WithReadinessCheck(check func(context.Context) error) Option
- func WithReadinessCheckInterval(interval time.Duration) Option
- func WithReadinessCheckTimeout(timeout time.Duration) Option
- func WithReadinessContext(ctx context.Context) Option
- func WithReflection(enabled bool) Option
- func WithStreamInterceptor(priority int, interceptor grpc.StreamServerInterceptor) Option
- func WithTLSConfig(clientCAFile, certFile, keyFile string) Option
- func WithTLSEnabled(enabled bool) Option
- func WithTracing(enabled bool) Option
- func WithUnaryInterceptor(priority int, interceptor grpc.UnaryServerInterceptor) Option
- type PermissionRegistry
- type Server
Constants ¶
const ( InterceptorPriorityPreprocess = 1 InterceptorPriorityObservability = 2 InterceptorPriorityAuthentication = 3 InterceptorPriorityBusinessLogic = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Server)
func WithMaxRecvMsgSize ¶
WithMaxRecvMsgSize sets the maximum receive message size.
func WithMaxSendMsgSize ¶
WithMaxSendMsgSize sets the maximum send message size.
func WithRateLimiter ¶
WithRateLimiter enables/disables rate limiting.
func WithReadinessContext ¶ added in v0.9.80
WithReadinessContext sets the parent context for the readiness monitor. Cancellation stops the monitor and sets the gRPC health status to NOT_SERVING.
func WithReflection ¶
WithReflection enables/disables reflection.
func WithStreamInterceptor ¶
func WithStreamInterceptor(priority int, interceptor grpc.StreamServerInterceptor) Option
WithStreamInterceptor adds a stream interceptor with a specific priority.
func WithTLSConfig ¶ added in v0.9.79
WithTLSConfig sets certificate files, loaded by New when TLS is enabled. Providing a client CA file requires verified client certificates for mutual TLS.
func WithTLSEnabled ¶ added in v0.9.79
WithTLSEnabled enables or disables TLS.
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(priority int, interceptor grpc.UnaryServerInterceptor) Option
WithUnaryInterceptor adds a unary interceptor with a specific priority.
type PermissionRegistry ¶
type PermissionRegistry struct {
// contains filtered or unexported fields
}
PermissionRegistry hold list of permissions for each grpc method. It is responsibility of the adapter to register permissions.
func NewPermissionRegistry ¶
func NewPermissionRegistry() *PermissionRegistry
func (*PermissionRegistry) PermissionsForMethod ¶
func (pr *PermissionRegistry) PermissionsForMethod(method string) []string
func (*PermissionRegistry) Register ¶
func (pr *PermissionRegistry) Register(method string, permissions ...string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Errors ¶ added in v0.9.80
Errors reports at most one unexpected termination, including startup failures. It closes when serving ends; shutdown requested through Shutdown closes it without an error.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |