Documentation
¶
Index ¶
- Variables
- func AuthorizationHeaderFromContext(ctx context.Context) string
- func ClientIPFromContext(ctx context.Context) string
- func LoadConfigFromEnv() (*config.GatewayConfig, error)
- func MustLoadConfig() *config.GatewayConfig
- func SetupRedisClient(ctx context.Context, redisUrl string, timeout time.Duration) (redis.UniversalClient, error)
- type AuthorizePublishFn
- type GatewayInterceptor
- type GatewayService
- type GatewayServiceBuilder
- func (b *GatewayServiceBuilder) Build() (GatewayService, error)
- func (b *GatewayServiceBuilder) WithAuthorizers(authorizers ...AuthorizePublishFn) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithBlockchainPublisher(blockchainPublisher blockchain.IBlockchainPublisher) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithClientMetrics(clientMetrics *grpcprom.ClientMetrics) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithContext(ctx context.Context) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithIdentityFn(identityFn IdentityFn) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithLogger(logger *zap.Logger) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithMetricsServer(metricsServer *metrics.Server) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithNodeRegistry(nodeRegistry registry.NodeRegistry) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithNonceManager(nonceManager noncemanager.NonceManager) IGatewayServiceBuilder
- func (b *GatewayServiceBuilder) WithPromRegistry(promRegistry *prometheus.Registry) IGatewayServiceBuilder
- type GatewayServiceError
- type IGatewayServiceBuilder
- type Identity
- type IdentityFn
- type IdentityKind
- type PermissionDeniedError
- type PublishRequest
- type PublishRequestSummary
- type RateLimit
- type UnauthenticatedError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingConfig = errors.New("config must be provided and not nil") )
Functions ¶
func ClientIPFromContext ¶
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() (*config.GatewayConfig, error)
func MustLoadConfig ¶
func MustLoadConfig() *config.GatewayConfig
func SetupRedisClient ¶
Types ¶
type AuthorizePublishFn ¶
type AuthorizePublishFn func(ctx context.Context, identity Identity, req PublishRequestSummary) (bool, error)
func NewRateLimitAuthorizer ¶
func NewRateLimitAuthorizer(config *config.GatewayConfig, rateLimit RateLimit) AuthorizePublishFn
type GatewayInterceptor ¶
type GatewayInterceptor struct {
// contains filtered or unexported fields
}
func NewGatewayInterceptor ¶
func NewGatewayInterceptor( logger *zap.Logger, identityFn IdentityFn, authorizers []AuthorizePublishFn, ) *GatewayInterceptor
func (*GatewayInterceptor) Stream ¶
func (i *GatewayInterceptor) Stream() grpc.StreamServerInterceptor
func (*GatewayInterceptor) Unary ¶
func (i *GatewayInterceptor) Unary() grpc.UnaryServerInterceptor
type GatewayService ¶
type GatewayService interface {
WaitForShutdown()
}
type GatewayServiceBuilder ¶
type GatewayServiceBuilder struct {
// contains filtered or unexported fields
}
func (*GatewayServiceBuilder) Build ¶
func (b *GatewayServiceBuilder) Build() (GatewayService, error)
func (*GatewayServiceBuilder) WithAuthorizers ¶
func (b *GatewayServiceBuilder) WithAuthorizers( authorizers ...AuthorizePublishFn, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithBlockchainPublisher ¶
func (b *GatewayServiceBuilder) WithBlockchainPublisher( blockchainPublisher blockchain.IBlockchainPublisher, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithClientMetrics ¶
func (b *GatewayServiceBuilder) WithClientMetrics( clientMetrics *grpcprom.ClientMetrics, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithContext ¶
func (b *GatewayServiceBuilder) WithContext( ctx context.Context, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithIdentityFn ¶
func (b *GatewayServiceBuilder) WithIdentityFn(identityFn IdentityFn) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithLogger ¶
func (b *GatewayServiceBuilder) WithLogger( logger *zap.Logger, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithMetricsServer ¶
func (b *GatewayServiceBuilder) WithMetricsServer( metricsServer *metrics.Server, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithNodeRegistry ¶
func (b *GatewayServiceBuilder) WithNodeRegistry( nodeRegistry registry.NodeRegistry, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithNonceManager ¶
func (b *GatewayServiceBuilder) WithNonceManager( nonceManager noncemanager.NonceManager, ) IGatewayServiceBuilder
func (*GatewayServiceBuilder) WithPromRegistry ¶
func (b *GatewayServiceBuilder) WithPromRegistry( promRegistry *prometheus.Registry, ) IGatewayServiceBuilder
type GatewayServiceError ¶
type IGatewayServiceBuilder ¶
type IGatewayServiceBuilder interface {
WithIdentityFn(identityFn IdentityFn) IGatewayServiceBuilder
WithAuthorizers(authorizers ...AuthorizePublishFn) IGatewayServiceBuilder
WithBlockchainPublisher(
blockchainPublisher blockchain.IBlockchainPublisher,
) IGatewayServiceBuilder
WithNodeRegistry(nodeRegistry registry.NodeRegistry) IGatewayServiceBuilder
WithLogger(logger *zap.Logger) IGatewayServiceBuilder
WithMetricsServer(metricsServer *metrics.Server) IGatewayServiceBuilder
WithContext(ctx context.Context) IGatewayServiceBuilder
WithPromRegistry(promRegistry *prometheus.Registry) IGatewayServiceBuilder
WithClientMetrics(clientMetrics *grpcprom.ClientMetrics) IGatewayServiceBuilder
WithNonceManager(nonceManager noncemanager.NonceManager) IGatewayServiceBuilder
Build() (GatewayService, error)
}
func NewGatewayServiceBuilder ¶
func NewGatewayServiceBuilder(config *config.GatewayConfig) IGatewayServiceBuilder
type IdentityKind ¶
type IdentityKind string
const ( IdentityKindIP IdentityKind = "ip" IdentityKindUserDefined IdentityKind = "user" )
type PermissionDeniedError ¶
type PermissionDeniedError struct {
// contains filtered or unexported fields
}
func NewPermissionDeniedError ¶
func NewPermissionDeniedError(msg string, err error) *PermissionDeniedError
func (PermissionDeniedError) ClientMessage ¶
func (e PermissionDeniedError) ClientMessage() string
func (PermissionDeniedError) Code ¶
func (e PermissionDeniedError) Code() codes.Code
func (PermissionDeniedError) Error ¶
func (e PermissionDeniedError) Error() string
type PublishRequest ¶
type PublishRequest *payer_api.PublishClientEnvelopesRequest
type PublishRequestSummary ¶
type PublishRequestSummary struct {
TotalEnvelopes int
OffchainCostEstimate currency.PicoDollar
OnchainCostEstimate currency.PicoDollar
TotalCostEstimate currency.PicoDollar
}
type UnauthenticatedError ¶
type UnauthenticatedError struct {
// contains filtered or unexported fields
}
func NewUnauthenticatedError ¶
func NewUnauthenticatedError(msg string, err error) *UnauthenticatedError
func (UnauthenticatedError) ClientMessage ¶
func (e UnauthenticatedError) ClientMessage() string
func (UnauthenticatedError) Code ¶
func (e UnauthenticatedError) Code() codes.Code
func (UnauthenticatedError) Error ¶
func (e UnauthenticatedError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.