Documentation
¶
Index ¶
- func CREStreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func CREUnaryInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func Value[T any](ctx context.Context, key any) T
- func WithCRE(ctx context.Context, cre CRE) context.Context
- type CRE
- type CREServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CREStreamInterceptor ¶
func CREStreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
CREStreamInterceptor is a grpc.StreamInterceptor that converts CRE context values to GRPC metadata.
func CREUnaryInterceptor ¶
func CREUnaryInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
CREUnaryInterceptor is a grpc.UnaryInterceptor that converts CRE context values to GRPC metadata.
Types ¶
type CRE ¶
CRE holds contextual Chainlink Runtime Environment metadata. This can include organization, owner, and workflow information. When a value is present, the higher scoped values are normally also available - except for Org, which may not be set. Typically injected via context.Context. See WithCRE & CREValue.
type CREServerInterceptor ¶
type CREServerInterceptor struct {
// contains filtered or unexported fields
}
CREServerInterceptor has methods that implement grpc.UnaryServerInterceptor and grpc.StreamServerInterceptor
func NewCREServerInterceptor ¶
func NewCREServerInterceptor(lggr logger.Logger) *CREServerInterceptor
func (*CREServerInterceptor) StreamServerInterceptor ¶
func (i *CREServerInterceptor) StreamServerInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamServerInterceptor is a grpc.StreamServerInterceptor that converts GRPC metadata to CRE context values.
func (*CREServerInterceptor) UnaryServerInterceptor ¶
func (i *CREServerInterceptor) UnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
UnaryServerInterceptor is a grpc.UnaryServerInterceptor that converts GRPC metadata to CRE context values.