broadcasts

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkip                  = errors.New("broadcast skipped")
	ErrSkipDoesNotMatch      = fmt.Errorf("%w: does not match", ErrSkip)
	ErrSkipAlreadyActive     = fmt.Errorf("%w: already active", ErrSkip)
	ErrSkipAlreadyShown      = fmt.Errorf("%w: already shown", ErrSkip)
	ErrSkipRemovedByMismatch = fmt.Errorf("%w: removed due to mismatch", ErrSkip)
	ErrSkipRemovedBySource   = fmt.Errorf("%w: removed by source", ErrSkip)
)

Errors.

Functions

func MakeNumericVersion

func MakeNumericVersion(version string) (numericVersion int64, err error)

MakeNumericVersion makes a numeric version with the first three version segment always using three digits.

Types

type Account

type Account struct {
	*access.UserRecord
	Active     bool
	UpToDate   bool
	FeatureIDs []account.FeatureID
}

Account holds SPN account matching data.

type BroadcastNotification

type BroadcastNotification struct {
	*notifications.Notification

	// Match holds a query string that needs to match the local matching data in
	// order for the broadcast to be displayed.
	Match string

	// AttachToModule signifies if the broadcast notification should be attached to the module.
	AttachToModule bool
	// Remove signifies that the broadcast should be canceled and its state removed.
	Remove bool
	// Permanent signifies that the broadcast cannot be acknowledge by the user
	// and remains in the UI indefinitely.
	Permanent bool
	// Repeat specifies a duration after which the broadcast should be shown again.
	Repeat string
	// contains filtered or unexported fields
}

BroadcastNotification is a single broadcast notification.

type BroadcastNotifications

type BroadcastNotifications struct {
	Notifications map[string]*BroadcastNotification
}

BroadcastNotifications holds the data structure of the broadcast notifications update file.

type BroadcastState

type BroadcastState struct {
	Read time.Time
}

BroadcastState holds state for a single broadcast notifications.

type BroadcastStates

type BroadcastStates struct {
	record.Base
	sync.Mutex

	States map[string]*BroadcastState
}

BroadcastStates holds states for broadcast notifications.

type Current

type Current struct {
	UnixTime int64
	UTC      *DateTime
	Local    *DateTime
}

Current holds current date and time data.

type DataError

type DataError struct {
	Error error
}

DataError represents an error getting some matching data.

type DateTime

type DateTime struct {
	NumericDateTime int64
	NumericDate     int64
	NumericTime     int64
}

DateTime holds date and time data in different formats.

type InstallInfo

type InstallInfo struct {
	record.Base
	sync.Mutex

	Version        string
	NumericVersion int64

	Time             time.Time
	NumericDate      int64
	DaysSinceInstall int64
	UnixTimestamp    int64
}

InstallInfo holds generic info about the install.

func GetInstallInfo

func GetInstallInfo() (*InstallInfo, error)

GetInstallInfo returns the install info from the database.

type Location

type Location struct {
	Country        string
	Coordinates    geoip.Coordinates
	ASN            uint
	ASOrg          string
	Source         netenv.DeviceLocationSource
	SourceAccuracy int
}

Location holds location matching data.

Jump to

Keyboard shortcuts

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