events

package
v0.0.0-...-e04ab08 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 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 DataConnect

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

type DataDNS

type DataDNS struct {
	Ips []string
}

type DataDisconnect

type DataDisconnect struct {
	Protocol              config.Protocol
	ServerFromAPI         bool
	Type                  TypeDisconnect
	Technology            config.Technology
	TargetServerSelection string
	ThreatProtectionLite  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 ServerRating

type ServerRating struct {
	Rate   int
	Server string
}

ServerRating last used server rating info

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 TypeConnect

type TypeConnect int
const (
	ConnectAttempt TypeConnect = iota
	ConnectSuccess
	ConnectFailure
)

type TypeDisconnect

type TypeDisconnect int
const (
	DisconnectAttempt TypeDisconnect = iota
	DisconnectSuccess
	DisconnectFailure
)

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