model

package
v3.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EventShareCreation = "share-creation"
	EventUpload        = "upload"
	EventFeedback      = "feedback"
	EventOfficeMention = "office-mention"
	EventTakeout       = "takeout"
)
View Source
const (
	TypeDirect      = "direct"
	TypeAccumulated = "accumulated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccumulationPolicy

type AccumulationPolicy struct {
	WindowSeconds int `json:"window_seconds" mapstructure:"window_seconds"`
	MaxItems      int `json:"max_items" mapstructure:"max_items"`
}

AccumulationPolicy controls how accumulated notifications are grouped.

type Envelope

type Envelope struct {
	ID             string         `json:"id"`
	EventType      string         `json:"event_type"`
	SubmittingUser string         `json:"submitting_user"`
	Recipients     []*userpb.User `json:"recipients"`
	TemplateData   map[string]any `json:"template_data,omitempty"`
	SubmittedAt    time.Time      `json:"submitted_at"`

	// The following fields are resolved by the notification worker from event
	// rules before dispatch or accumulation. They are not accepted from
	// producers.
	Type         string             `json:"type,omitempty"`
	DedupKey     string             `json:"dedup_key,omitempty"`
	Handlers     []string           `json:"handlers,omitempty"`
	TemplateName string             `json:"template_name,omitempty"`
	Accumulation AccumulationPolicy `json:"accumulation,omitempty"`
}

Envelope is the durable notification message sent through NATS and stored in SQL for accumulated notifications.

type EventRule

type EventRule struct {
	Type             string                 `json:"type" mapstructure:"type"`
	DedupKeyTemplate string                 `json:"dedup_key_template,omitempty" mapstructure:"dedup_key_template"`
	Handlers         map[string]HandlerRule `json:"handlers" mapstructure:"handlers"`
	Accumulation     AccumulationPolicy     `json:"accumulation,omitempty" mapstructure:"accumulation"`
}

EventRule configures how one notification event type is delivered.

type HandlerRule

type HandlerRule struct {
	TemplateName string `json:"template_name,omitempty" mapstructure:"template_name"`
}

HandlerRule configures one handler for a notification event.

Jump to

Keyboard shortcuts

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