Documentation
¶
Index ¶
- Constants
- func NewBalanceThresholdPayload() notification.EventPayload
- func NewClickhouseClient(addr string) (clickhousedriver.Conn, error)
- func NewCreateChannelInput(name string) notification.CreateChannelInput
- func NewCreateEventInput(t notification.EventType, ruleID string, payload notification.EventPayload) notification.CreateEventInput
- func NewCreateRuleInput(name string, channels ...string) notification.CreateRuleInput
- func NewCreateWebhookInput(id *string, desc string) notificationwebhook.CreateWebhookInput
- func NewMeterRepository() meter.Repository
- func NewSvixAuthToken(signingSecret string) (string, error)
- type ChannelTestSuite
- func (s *ChannelTestSuite) TestCreate(ctx context.Context, t *testing.T)
- func (s *ChannelTestSuite) TestDelete(ctx context.Context, t *testing.T)
- func (s *ChannelTestSuite) TestGet(ctx context.Context, t *testing.T)
- func (s *ChannelTestSuite) TestList(ctx context.Context, t *testing.T)
- func (s *ChannelTestSuite) TestUpdate(ctx context.Context, t *testing.T)
- type EventTestSuite
- func (s *EventTestSuite) Setup(ctx context.Context, t *testing.T)
- func (s *EventTestSuite) TestCreateEvent(ctx context.Context, t *testing.T)
- func (s *EventTestSuite) TestGetEvent(ctx context.Context, t *testing.T)
- func (s *EventTestSuite) TestListDeliveryStatus(ctx context.Context, t *testing.T)
- func (s *EventTestSuite) TestListEvents(ctx context.Context, t *testing.T)
- func (s *EventTestSuite) TestUpdateDeliveryStatus(ctx context.Context, t *testing.T)
- type RuleTestSuite
- func (s *RuleTestSuite) Setup(ctx context.Context, t *testing.T)
- func (s *RuleTestSuite) TestCreate(ctx context.Context, t *testing.T)
- func (s *RuleTestSuite) TestDelete(ctx context.Context, t *testing.T)
- func (s *RuleTestSuite) TestGet(ctx context.Context, t *testing.T)
- func (s *RuleTestSuite) TestList(ctx context.Context, t *testing.T)
- func (s *RuleTestSuite) TestUpdate(ctx context.Context, t *testing.T)
- type TestEnv
- type WebhookTestSuite
- func (s *WebhookTestSuite) Setup(ctx context.Context, t *testing.T)
- func (s *WebhookTestSuite) TestCreateWebhook(ctx context.Context, t *testing.T)
- func (s *WebhookTestSuite) TestDeleteWebhook(ctx context.Context, t *testing.T)
- func (s *WebhookTestSuite) TestGetWebhook(ctx context.Context, t *testing.T)
- func (s *WebhookTestSuite) TestListWebhook(ctx context.Context, t *testing.T)
- func (s *WebhookTestSuite) TestUpdateWebhook(ctx context.Context, t *testing.T)
Constants ¶
View Source
const ( TestNamespace = "default" TestMeterSlug = "api-call" TestFeatureName = "API Requests" TestFeatureKey = "api-call" TestSubjectKey = "john-doe" // TestWebhookURL is the target URL where the notifications are sent to. // Use the following URL to verify notifications events sent over webhook channel: // https://play.svix.com/view/e_eyihAQHBB5d6T9ck1iYevP825pg TestWebhookURL = "https://play.svix.com/in/e_eyihAQHBB5d6T9ck1iYevP825pg/" // TestSigningSecret used for verifying events sent to webhook. TestSigningSecret = "whsec_Fk5kgr5qTdPdQIDniFv+6K0WN2bUpdGjjGtaNeAx8N8=" PostgresURLTemplate = "postgres://postgres:postgres@%s:5432/postgres?sslmode=disable" SvixServerURLTemplate = "http://%s:8071" )
View Source
const ( DefaultPostgresHost = "127.0.0.1" DefaultSvixHost = "127.0.0.1" DefaultSvixJWTSigningSecret = "" /* 231-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func NewBalanceThresholdPayload ¶
func NewBalanceThresholdPayload() notification.EventPayload
func NewClickhouseClient ¶
func NewClickhouseClient(addr string) (clickhousedriver.Conn, error)
func NewCreateChannelInput ¶
func NewCreateChannelInput(name string) notification.CreateChannelInput
func NewCreateEventInput ¶
func NewCreateEventInput(t notification.EventType, ruleID string, payload notification.EventPayload) notification.CreateEventInput
func NewCreateRuleInput ¶
func NewCreateRuleInput(name string, channels ...string) notification.CreateRuleInput
func NewCreateWebhookInput ¶
func NewCreateWebhookInput(id *string, desc string) notificationwebhook.CreateWebhookInput
func NewMeterRepository ¶
func NewMeterRepository() meter.Repository
func NewSvixAuthToken ¶
Types ¶
type ChannelTestSuite ¶
type ChannelTestSuite struct {
Env TestEnv
}
func (*ChannelTestSuite) TestCreate ¶
func (s *ChannelTestSuite) TestCreate(ctx context.Context, t *testing.T)
func (*ChannelTestSuite) TestDelete ¶
func (s *ChannelTestSuite) TestDelete(ctx context.Context, t *testing.T)
func (*ChannelTestSuite) TestGet ¶
func (s *ChannelTestSuite) TestGet(ctx context.Context, t *testing.T)
func (*ChannelTestSuite) TestList ¶
func (s *ChannelTestSuite) TestList(ctx context.Context, t *testing.T)
func (*ChannelTestSuite) TestUpdate ¶
func (s *ChannelTestSuite) TestUpdate(ctx context.Context, t *testing.T)
type EventTestSuite ¶
type EventTestSuite struct {
Env TestEnv
// contains filtered or unexported fields
}
func (*EventTestSuite) TestCreateEvent ¶
func (s *EventTestSuite) TestCreateEvent(ctx context.Context, t *testing.T)
func (*EventTestSuite) TestGetEvent ¶
func (s *EventTestSuite) TestGetEvent(ctx context.Context, t *testing.T)
func (*EventTestSuite) TestListDeliveryStatus ¶
func (s *EventTestSuite) TestListDeliveryStatus(ctx context.Context, t *testing.T)
func (*EventTestSuite) TestListEvents ¶
func (s *EventTestSuite) TestListEvents(ctx context.Context, t *testing.T)
func (*EventTestSuite) TestUpdateDeliveryStatus ¶
func (s *EventTestSuite) TestUpdateDeliveryStatus(ctx context.Context, t *testing.T)
type RuleTestSuite ¶
type RuleTestSuite struct {
Env TestEnv
// contains filtered or unexported fields
}
func (*RuleTestSuite) TestCreate ¶
func (s *RuleTestSuite) TestCreate(ctx context.Context, t *testing.T)
func (*RuleTestSuite) TestDelete ¶
func (s *RuleTestSuite) TestDelete(ctx context.Context, t *testing.T)
func (*RuleTestSuite) TestList ¶
func (s *RuleTestSuite) TestList(ctx context.Context, t *testing.T)
func (*RuleTestSuite) TestUpdate ¶
func (s *RuleTestSuite) TestUpdate(ctx context.Context, t *testing.T)
type TestEnv ¶
type TestEnv interface {
NotificationRepo() notification.Repository
Notification() notification.Service
NotificationWebhook() notificationwebhook.Handler
Feature() productcatalog.FeatureConnector
Meter() meter.Repository
Close() error
}
type WebhookTestSuite ¶
type WebhookTestSuite struct {
Env TestEnv
}
func (*WebhookTestSuite) Setup ¶
func (s *WebhookTestSuite) Setup(ctx context.Context, t *testing.T)
func (*WebhookTestSuite) TestCreateWebhook ¶
func (s *WebhookTestSuite) TestCreateWebhook(ctx context.Context, t *testing.T)
func (*WebhookTestSuite) TestDeleteWebhook ¶
func (s *WebhookTestSuite) TestDeleteWebhook(ctx context.Context, t *testing.T)
func (*WebhookTestSuite) TestGetWebhook ¶
func (s *WebhookTestSuite) TestGetWebhook(ctx context.Context, t *testing.T)
func (*WebhookTestSuite) TestListWebhook ¶
func (s *WebhookTestSuite) TestListWebhook(ctx context.Context, t *testing.T)
func (*WebhookTestSuite) TestUpdateWebhook ¶
func (s *WebhookTestSuite) TestUpdateWebhook(ctx context.Context, t *testing.T)
Click to show internal directories.
Click to hide internal directories.