model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownTags = struct {
	Error        string
	Warning      string
	Notification string
}{
	Error:        "error",
	Warning:      "warning",
	Notification: "notification",
}

Functions

This section is empty.

Types

type Message

type Message struct {
	Sender string   `json:"sender"`
	Title  string   `json:"title"`
	Body   string   `json:"body"`
	Tags   []string `json:"tags"`
}

type MessageFilter

type MessageFilter struct {
	Type  MessageFilterType
	Value string
}

func (*MessageFilter) Match

func (this *MessageFilter) Match(message Message) bool

type MessageFilterType

type MessageFilterType string
const SenderFilter MessageFilterType = "sender"
const TagFilter MessageFilterType = "tag"

type Subscription

type Subscription struct {
	Key                        string          `json:"key"` //used to identify the subscription
	Receiver                   string          `json:"receiver"`
	DistinctTimeWindow         string          `json:"distinct_time_window"`
	DistinctTimeWindowDuration time.Duration   `json:"-"`
	Filter                     []MessageFilter `json:"filter"`                   //subscription is a match if no filter is not a match
	AdditionalReceiverInfo     string          `json:"additional_receiver_info"` //it is the receivers concern to interpret this field however it needs to
	Disabled                   bool            `json:"disabled"`
}

func (*Subscription) Match

func (this *Subscription) Match(message Message) bool

Jump to

Keyboard shortcuts

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