database

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Id                   primitive.ObjectID       `bson:"_id"`
	OwnerId              primitive.ObjectID       `bson:"ownerId"`
	Type                 apiPb.ComponentOwnerType `bson:"type"`
	NotificationMethodId primitive.ObjectID       `bson:"notificationMethodId"`
}

type NotificationListDb

type NotificationListDb interface {
	Add(ctx context.Context, notification *Notification) error
	Delete(ctx context.Context, id primitive.ObjectID) error
	GetList(ctx context.Context, OwnerId primitive.ObjectID, Type apiPb.ComponentOwnerType) ([]*Notification, error)
}

type NotificationMethod

type NotificationMethod struct {
	Id      primitive.ObjectID             `bson:"_id"`
	Name    string                         `bson:"name"`
	Status  apiPb.NotificationMethodStatus `bson:"status"`
	Type    apiPb.NotificationMethodType   `bson:"type"`
	Slack   *SlackConfig                   `bson:"slackConfig,omitempty"`
	WebHook *WebHookConfig                 `bson:"webhookConfig,omitempty"`
}

type NotificationMethodDb

type NotificationMethodDb interface {
	Create(ctx context.Context, nm *NotificationMethod) error
	Delete(ctx context.Context, id primitive.ObjectID) error
	Activate(ctx context.Context, id primitive.ObjectID) error
	Deactivate(ctx context.Context, id primitive.ObjectID) error
	Get(ctx context.Context, id primitive.ObjectID) (*NotificationMethod, error)
	GetAll(ctx context.Context) ([]*NotificationMethod, error)
}

type SlackConfig

type SlackConfig struct {
	Url string `bson:"string"`
}

type WebHookConfig

type WebHookConfig struct {
	Url string `bson:"string"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL