events

package
v0.0.0-...-aa2490a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountUpdateEvents

type AccountUpdateEvents struct {
	SubscriptionUpdate events.PublishSubcriber[*pb.AccountModification]
}

func NewAccountUpdateEvents

func NewAccountUpdateEvents() *AccountUpdateEvents

func (*AccountUpdateEvents) Subscribe

type AccountUpdatePublisher

type AccountUpdatePublisher interface {
	NotifySubscriptionChanged(*pb.AccountModification) error
}

type ConfigEvents

type ConfigEvents struct {
	Config events.PublishSubcriber[*config.Config]
}

func NewConfigEvents

func NewConfigEvents() *ConfigEvents

func (*ConfigEvents) Subscribe

func (c *ConfigEvents) Subscribe(to ConfigPublisher)

type ConfigPublisher

type ConfigPublisher interface {
	NotifyConfigChanged(cfg *config.Config) error
}

type DataUpdateEvents

type DataUpdateEvents struct {
	ServersUpdate events.PublishSubcriber[any]
}

func NewDataUpdateEvents

func NewDataUpdateEvents() *DataUpdateEvents

func (*DataUpdateEvents) Subscribe

func (d *DataUpdateEvents) Subscribe(to DataUpdatePublisher)

type DataUpdatePublisher

type DataUpdatePublisher interface {
	NotifyServersListUpdate(any) error
}

type Events

type Events struct {
	Settings *SettingsEvents
	Service  *ServiceEvents
	User     *LoginEvents
}

func NewEventsEmpty

func NewEventsEmpty() *Events

func (*Events) Subscribe

func (e *Events) Subscribe(to Publisher)

type LoginEvents

func (*LoginEvents) Subscribe

func (l *LoginEvents) Subscribe(to LoginPublisher)

type LoginPublisher

type LoginPublisher interface {
	NotifyLogin(events.DataAuthorization) error
	NotifyLogout(events.DataAuthorization) error
	NotifyMFA(bool) error
}

type MockPublisherSubscriber

type MockPublisherSubscriber[T any] struct {
	EventPublished bool
	Event          T
}

func (*MockPublisherSubscriber[T]) Publish

func (mp *MockPublisherSubscriber[T]) Publish(message T)

func (*MockPublisherSubscriber[T]) Subscribe

func (*MockPublisherSubscriber[T]) Subscribe(handler events.Handler[T])

type Publisher

type Publisher interface {
	SettingsPublisher
	ServicePublisher
	LoginPublisher
}

type ServiceEvents

func (*ServiceEvents) Subscribe

func (s *ServiceEvents) Subscribe(to ServicePublisher)

type ServicePublisher

type ServicePublisher interface {
	NotifyConnect(events.DataConnect) error
	NotifyDisconnect(events.DataDisconnect) error
	NotifyAccountCheck(any) error
	NotifyUiItemsClick(events.UiItemsAction) error
	NotifyDeviceLocation(core.Insights) error
}

type SettingsEvents

func (*SettingsEvents) Publish

func (s *SettingsEvents) Publish(cfg config.Config)

func (*SettingsEvents) Subscribe

func (s *SettingsEvents) Subscribe(to SettingsPublisher)

type SettingsPublisher

type SettingsPublisher interface {
	NotifyKillswitch(bool) error
	NotifyAutoconnect(bool) error
	NotifyDNS(events.DataDNS) error
	NotifyThreatProtectionLite(bool) error
	NotifyProtocol(config.Protocol) error
	NotifyAllowlist(events.DataAllowlist) error
	NotifyTechnology(config.Technology) error
	NotifyObfuscate(bool) error
	NotifyFirewall(bool) error
	NotifyRouting(bool) error
	NotifyNotify(bool) error
	NotifyMeshnet(bool) error
	NotifyIpv6(bool) error
	NotifyDefaults(any) error
	NotifyLANDiscovery(bool) error
	NotifyVirtualLocation(bool) error
	NotifyPostquantumVpn(bool) error
}

Jump to

Keyboard shortcuts

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