Documentation ¶
Index ¶
- Variables
- type Service
- func (s *Service) Add(ctx context.Context, userContext am.UserContext, events []*am.Event) error
- func (s *Service) Get(ctx context.Context, userContext am.UserContext, filter *am.EventFilter) ([]*am.Event, error)
- func (s *Service) GetSettings(ctx context.Context, userContext am.UserContext) (*am.UserEventSettings, error)
- func (s *Service) GetWebhookEvents(ctx context.Context, userContext am.UserContext) ([]*am.WebhookEvent, error)
- func (s *Service) GetWebhooks(ctx context.Context, userContext am.UserContext) ([]*am.WebhookEventSettings, error)
- func (s *Service) Init(config []byte) error
- func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool
- func (s *Service) MarkRead(ctx context.Context, userContext am.UserContext, notificationIDs []int64) error
- func (s *Service) NotifyComplete(ctx context.Context, userContext am.UserContext, startTime int64, groupID int) error
- func (s *Service) UpdateSettings(ctx context.Context, userContext am.UserContext, ...) error
- func (s *Service) UpdateWebhooks(ctx context.Context, userContext am.UserContext, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Add Webhook results WebhookTempTableKey = "event_webhook_add_temp" WebhookTempTableColumns = []string{"organization_id", "scan_group_id", "notification_id", "webhook_id", "type_id", "last_attempt_timestamp", "last_attempt_status"} WebhookTempTable = `` /* 253-byte string literal not displayed */ TempToWebhook = `` /* 377-byte string literal not displayed */ // Add Events AddTempTableKey = "event_add_temp" AddTempTableColumns = []string{"organization_id", "scan_group_id", "type_id", "event_timestamp", "event_data", "event_data_json"} AddTempTable = `` /* 228-byte string literal not displayed */ AddTempToAdd = `` /* 422-byte string literal not displayed */ SubscriptionsTempTableKey = "event_subs_temp" SubscriptionsTempTableColumns = []string{"organization_id", "user_id", "type_id", "subscribed_since", "subscribed"} SubscriptionsTempTable = `` /* 216-byte string literal not displayed */ SubscriptionsTempToSubscriptions = `` /* 411-byte string literal not displayed */ MarkReadTempTableKey = "event_read_temp" MarkReadTempTableColumns = []string{"organization_id", "user_id", "notification_id"} MarkReadTempTable = `` /* 153-byte string literal not displayed */ MarkReadTempToMarkRead = `` /* 224-byte string literal not displayed */ )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service for interfacing with postgresql/rds
func New ¶
func New(authorizer auth.Authorizer, hooks webhooks.Webhooker) *Service
New returns an empty Service
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, userContext am.UserContext, filter *am.EventFilter) ([]*am.Event, error)
func (*Service) GetSettings ¶
func (s *Service) GetSettings(ctx context.Context, userContext am.UserContext) (*am.UserEventSettings, error)
func (*Service) GetWebhookEvents ¶
func (s *Service) GetWebhookEvents(ctx context.Context, userContext am.UserContext) ([]*am.WebhookEvent, error)
func (*Service) GetWebhooks ¶
func (s *Service) GetWebhooks(ctx context.Context, userContext am.UserContext) ([]*am.WebhookEventSettings, error)
func (*Service) IsAuthorized ¶
func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool
IsAuthorized checks if an action is allowed by a particular user
func (*Service) MarkRead ¶
func (s *Service) MarkRead(ctx context.Context, userContext am.UserContext, notificationIDs []int64) error
MarkRead events
func (*Service) NotifyComplete ¶
func (s *Service) NotifyComplete(ctx context.Context, userContext am.UserContext, startTime int64, groupID int) error
NotifyComplete that a scan group has completed
func (*Service) UpdateSettings ¶
func (s *Service) UpdateSettings(ctx context.Context, userContext am.UserContext, settings *am.UserEventSettings) error
UpdateSettings for user
func (*Service) UpdateWebhooks ¶
func (s *Service) UpdateWebhooks(ctx context.Context, userContext am.UserContext, webhook *am.WebhookEventSettings) (err error)
UpdateWebhooks or insert new (uniqueness on org,groupid,name)
Click to show internal directories.
Click to hide internal directories.