controller

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func (*Controller) CreateBroker

func (this *Controller) CreateBroker(token auth.Token, broker model.Broker) (result model.Broker, err error, errCode int)

func (*Controller) CreateNotification

func (this *Controller) CreateNotification(token *auth.Token, notification model.Notification, ignoreDuplicatesWithinSeconds *int64) (result model.Notification, err error, errCode int)

func (*Controller) DeleteFcmToken

func (this *Controller) DeleteFcmToken(token auth.Token, fcmToken string) (err error, errCode int)

func (*Controller) DeleteMultipleBrokers

func (this *Controller) DeleteMultipleBrokers(token auth.Token, ids []string) (err error, errCode int)

func (*Controller) DeleteMultipleNotifications

func (this *Controller) DeleteMultipleNotifications(token auth.Token, ids []string) (err error, errCode int)

func (*Controller) DeletePlatformBroker

func (this *Controller) DeletePlatformBroker(token auth.Token) (err error, errCode int)

func (*Controller) GetPlatformBroker

func (this *Controller) GetPlatformBroker(token auth.Token) (platformBroker model.PlatformBroker, err error, errCode int)

func (*Controller) GetSettings added in v0.0.4

func (this *Controller) GetSettings(token auth.Token) (settings model.Settings, err error, errCode int)

func (*Controller) HandleWs

func (this *Controller) HandleWs(conn *websocket.Conn)

func (*Controller) ListBrokers

func (this *Controller) ListBrokers(token auth.Token, options persistence.ListOptions) (result model.BrokerList, err error, errCode int)

func (*Controller) ListNotifications

func (this *Controller) ListNotifications(token auth.Token, options persistence.ListOptions, channel model.Channel) (result model.NotificationList, err error, errCode int)

func (*Controller) PutFcmToken

func (this *Controller) PutFcmToken(token auth.Token, fcmToken string) (err error, errCode int)

func (*Controller) ReadBroker

func (this *Controller) ReadBroker(token auth.Token, id string) (result model.Broker, err error, errCode int)

func (*Controller) ReadNotification

func (this *Controller) ReadNotification(token auth.Token, id string) (result model.Notification, err error, errCode int)

func (*Controller) SetBroker

func (this *Controller) SetBroker(token auth.Token, broker model.Broker) (result model.Broker, err error, errCode int)

func (*Controller) SetNotification

func (this *Controller) SetNotification(token auth.Token, notification model.Notification) (result model.Notification, err error, errCode int)

func (*Controller) SetPlatformBroker

func (this *Controller) SetPlatformBroker(token auth.Token, platformBroker model.PlatformBroker) (result model.PlatformBroker, err error, errCode int)

func (*Controller) SetSettings added in v0.0.4

func (this *Controller) SetSettings(token auth.Token, settings model.Settings) (result model.Settings, err error, errCode int)

type FromTo added in v0.0.4

type FromTo = struct {
	Name  string
	Email string
}

type KeycloakUser added in v0.0.10

type KeycloakUser struct {
	ID               string `json:"id"`
	CreatedTimestamp int64  `json:"createdTimestamp"`
	Username         string `json:"username"`
	Enabled          bool   `json:"enabled"`
	Totp             bool   `json:"totp"`
	EmailVerified    bool   `json:"emailVerified"`
	FirstName        string `json:"firstName"`
	LastName         string `json:"lastName"`
	Email            string `json:"email"`
	Attributes       struct {
		Locale []string `json:"locale"`
	} `json:"attributes"`
	DisableableCredentialTypes []any `json:"disableableCredentialTypes"`
	RequiredActions            []any `json:"requiredActions"`
	NotBefore                  int   `json:"notBefore"`
	Access                     struct {
		ManageGroupMembership bool `json:"manageGroupMembership"`
		View                  bool `json:"view"`
		MapRoles              bool `json:"mapRoles"`
		Impersonate           bool `json:"impersonate"`
		Manage                bool `json:"manage"`
	} `json:"access"`
}

type Persistence

type Persistence interface {
	ListNotifications(userId string, options persistence.ListOptions, topics []model.Topic) (result []model.Notification, total int64, err error, errCode int)
	ReadNotification(userId string, id string) (result model.Notification, err error, errCode int)
	ReadNotificationByHash(userId string, hash [32]byte, notOlderThan time.Time) (result model.Notification, err error, errCode int)
	SetNotification(notification model.Notification) (err error, errCode int)
	RemoveNotifications(userId string, ids []string) (err error, errCode int)

	ListBrokers(userId string, options persistence.ListOptions) (result []model.Broker, total int64, err error, errCode int)
	ListEnabledBrokers(userId string) (result []model.Broker, err error)
	ReadBroker(userId string, id string) (result model.Broker, err error, errCode int)
	SetBroker(broker model.Broker) (err error, errCode int)
	RemoveBrokers(userId string, ids []string) (err error, errCode int)

	ReadPlatformBroker(userId string) (platformBroker model.PlatformBroker, err error, errCode int)
	SetPlatformBroker(platformBroker model.PlatformBroker) (err error, errCode int)
	RemovePlatformBroker(userId string) (err error, errCode int)

	UpsertFcmToken(token model.FcmToken) (err error, errCode int)
	DeleteFcmToken(token model.FcmToken) (err error, errCode int)
	GetFcmTokens(userId string) (tokens []model.FcmToken, err error)

	ReadSettings(userId string) (result model.Settings, err error, errCode int)
	SetSettings(settings model.Settings) (error, int)
}

type SendRequest added in v0.0.4

type SendRequest mailpit.SendRequest

func (*SendRequest) Send added in v0.0.4

func (s *SendRequest) Send(remoteAddress string) (messageId string, err error)

type WsSession

type WsSession struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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