events

package
v0.0.0-...-a70aae6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package events provides publisher-subscriber interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analytics

type Analytics interface {
	Enable() error
	Disable() error
}

Analytics analytics handling engine interface

type DataAllowlist

type DataAllowlist struct {
	Subnets  []string
	TCPPorts []int64
	UDPPorts []int64
}

type DataAuthorization

type DataAuthorization struct {
	DurationMs   int
	EventTrigger TypeEventTrigger
	EventStatus  TypeEventStatus
	EventType    TypeLoginType
}

type DataConnect

type DataConnect struct {
	IsMeshnetPeer              bool
	APIHostname                string
	Auto                       bool
	ThreatProtectionLite       bool
	Protocol                   config.Protocol
	ResponseServersCount       int
	ResponseTime               int
	DurationMs                 int
	ServerFromAPI              bool
	EventStatus                TypeEventStatus
	TargetServerSelection      string
	Technology                 config.Technology
	TargetServerCity           string
	TargetServerCountry        string
	TargetServerDomain         string
	TargetServerGroup          string
	TargetServerIP             string
	TargetServerPick           string
	TargetServerPickerResponse string
	TargetServerName           string
	Error                      error
}

type DataDNS

type DataDNS struct {
	Ips []string
}

type DataDisconnect

type DataDisconnect struct {
	Protocol              config.Protocol
	ServerFromAPI         bool
	EventStatus           TypeEventStatus
	Technology            config.Technology
	TargetServerSelection string
	ThreatProtectionLite  bool
	ByUser                bool
}

type DataRequestAPI

type DataRequestAPI struct {
	// Note: Never use `Request.Body`, use `Request.GetBody` instead
	Request *http.Request
	// Note: In case you read `Response.Body`, make sure it is set to what it was before
	Response *http.Response
	Duration time.Duration
	Error    error
}

type Handler

type Handler[T any] func(T) error

Handler is used to process messages.

type PublishSubcriber

type PublishSubcriber[T any] interface {
	Publisher[T]
	Subscriber[T]
}

PublishSubcriber allows both publishing and subscribing to messages of type T.

type Publisher

type Publisher[T any] interface {
	Publish(message T)
}

Publisher allows publishing messages of type T.

type Subscriber

type Subscriber[T any] interface {
	// Subscribe allows registering multiple handlers for the same message.
	Subscribe(Handler[T])
}

Subscriber listens to messages of type T.

type TypeEventStatus

type TypeEventStatus int
const (
	StatusAttempt TypeEventStatus = iota
	StatusSuccess
	StatusFailure
	StatusCanceled
)

type TypeEventTrigger

type TypeEventTrigger int
const (
	TriggerApp TypeEventTrigger = iota
	TriggerUser
)

type TypeLoginType

type TypeLoginType int
const (
	LoginLogin  TypeLoginType = iota // regular login
	LoginSignUp                      // login after signup
)

type UiItemsAction

type UiItemsAction struct {
	ItemName      string
	ItemType      string
	ItemValue     string
	FormReference string
}

UiItemsAction stores arguments to moose.NordvpnappSendUserInterfaceUiItemsClick

Directories

Path Synopsis
Package MeshUnsetter responsible for unsetting meshnet if got 404 on api request
Package MeshUnsetter responsible for unsetting meshnet if got 404 on api request
Package refresher is responsible for refreshing application state on specific events.
Package refresher is responsible for refreshing application state on specific events.
Package subs is responsible for communication between modules and it facilitates dependency decoupling.
Package subs is responsible for communication between modules and it facilitates dependency decoupling.

Jump to

Keyboard shortcuts

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