nfymsg

package
v0.33.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Base

	AlertID     int // The global alert number
	Summary     string
	Details     string
	ServiceID   string
	ServiceName string
	Meta        map[string]string

	// OriginalStatus is the status of the first Alert notification to this Dest for this AlertID.
	OriginalStatus *SendResult
}

Alert represents outgoing notifications for alerts.

type AlertBundle

type AlertBundle struct {
	Base

	ServiceID   string
	ServiceName string // The service being notified for
	Count       int    // Number of unacked alerts
}

AlertBundle represents a bundle of outgoing alert notifications for a single service.

type AlertState

type AlertState int

AlertState is the current state of an Alert.

const (
	AlertStateUnknown AlertState = iota
	AlertStateUnacknowledged
	AlertStateAcknowledged
	AlertStateClosed
)

All alert states

type AlertStatus

type AlertStatus struct {
	Base

	AlertID   int
	LogEntry  string
	ServiceID string

	// Summary of the alert that this status is in regards to.
	Summary string
	// Details of the alert that this status is in regards to.
	Details string

	// OriginalStatus is the status of the first Alert notification to this Dest for this AlertID.
	OriginalStatus SendResult

	// NewAlertState contains the most recent state of the alert.
	NewAlertState AlertState
}

type Base

type Base struct {
	ID   string
	Dest gadb.DestV1
}

func (Base) DestArg

func (b Base) DestArg(name string) string

func (Base) DestType

func (b Base) DestType() string

func (Base) MsgID

func (b Base) MsgID() string

type Message

type Message interface {
	MsgID() string
	DestType() string
	DestArg(name string) string
}

A Message contains information that can be provided to a user for notification.

type ScheduleOnCallUsers

type ScheduleOnCallUsers struct {
	Base

	ScheduleID   string
	ScheduleName string
	ScheduleURL  string

	Users []User
}

ScheduleOnCallUsers is a Message that indicates which users are currently on-call for a Schedule

type SendResult

type SendResult struct {
	// ID is the GoAlert message ID.
	ID string

	// ProviderMessageID is an identifier that represents the provider-specific ID
	// of the message (e.g. Twilio SID).
	ProviderMessageID gadb.ProviderMessageID

	Status

	DestType string
}

SendResult represents the result of a sent message.

type SentMessage

type SentMessage struct {
	ExternalID   string
	State        State
	StateDetails string
	SrcValue     string
}

SentMessage contains information about a message that was sent to a remote system.

type SignalMessage

type SignalMessage struct {
	Base

	Params map[string]string
}

SignalMessage is a dynamic message that is sent to a notification destination.

func (SignalMessage) Param

func (t SignalMessage) Param(name string) string

type State

type State int

State represents the current state of an outgoing message.

const (
	// StateUnknown is returned when the message has not yet been sent.
	StateUnknown State = iota

	// StateSending should be specified when a message is sending but has not been sent.
	// This includes things like remotely queued, ringing, or in-progress calls.
	StateSending

	// StatePending indicates a message waiting to be sent.
	StatePending

	// StateSent means the message has been sent completely, but may not
	// have been delivered (or delivery confirmation is not supported.). For
	// example, an SMS on the carrier network (but not device) or a voice call
	// that rang but got `no-answer`.
	StateSent

	// StateDelivered means the message is completed and was received
	// by the end device. SMS delivery confirmation, or a voice call was
	// completed (including if it was voice mail).
	StateDelivered

	// StateFailedTemp should be set when a message was not sent (no SMS or ringing phone)
	// but a subsequent try later may succeed. (e.g. voice call with busy signal).
	StateFailedTemp

	// StateFailedPerm should be set when a message was not sent (no SMS or ringing phone)
	// but a subsequent attempt will not be expected to succeed. For messages that fail due to
	// invalid config, they should set this state, as without manual intervention, a retry
	// will also fail.
	StateFailedPerm

	// StateBundled indicates that the message has been bundled into another message.
	StateBundled
)

func (State) IsOK

func (s State) IsOK() bool

IsOK returns true if the message has passed successfully to a remote system (StateSending, StateSent, or StateDelivered).

type Status

type Status struct {
	// State is the current state.
	State State

	// Details can contain any additional information about the State (e.g. "ringing", "no-answer" etc..).
	Details string

	// Sequence can be used when the provider sends updates out-of order (e.g. Twilio).
	// The Sequence number defaults to 0, and a status update is ignored unless its
	// Sequence number is >= the current one.
	Sequence int

	// SrcValue can be used to set/update the source value of the message.
	SrcValue string

	// Age is the time since the message was first sent. Ignored for new messages.
	Age time.Duration
}

Status describes the current state of an outgoing message.

type Test

type Test struct {
	Base
}

Test represents outgoing test notification.

type User

type User struct {
	ID   string
	Name string
	URL  string
}

User provides information about a user for notifications.

type Verification

type Verification struct {
	Base
	Code string
}

Verification represents outgoing verification code.

Jump to

Keyboard shortcuts

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