Documentation
¶
Index ¶
- Variables
- type ActionParamError
- type ActionValidator
- type Cursorable
- type DestArgError
- type DestValidator
- type DisplayInfo
- type DynamicParamConfig
- type FieldConfig
- type FieldSearcher
- type FieldValue
- type Fieldable
- type MessageSender
- type MessageStatuser
- type OptionFrommer
- type ParamValidator
- type Provider
- type Registry
- func (r *Registry) DisplayInfo(ctx context.Context, d gadb.DestV1) (*DisplayInfo, error)
- func (r *Registry) FieldLabel(ctx context.Context, typeID, fieldID, value string) (string, error)
- func (r *Registry) IsDynamicAction(ctx context.Context, typeID string) (bool, error)
- func (r *Registry) LookupTypeName(ctx context.Context, typeID string) (string, error)
- func (r *Registry) MessageStatus(ctx context.Context, destType string, externalID string) (*nfymsg.Status, error)
- func (r *Registry) Provider(id string) Provider
- func (r *Registry) RegisterProvider(ctx context.Context, p Provider)
- func (r *Registry) SearchField(ctx context.Context, typeID, fieldID string, options SearchOptions) (*SearchResult, error)
- func (r *Registry) SendMessage(ctx context.Context, msg nfymsg.Message) (*nfymsg.SentMessage, error)
- func (r *Registry) StubNotifiers()
- func (r *Registry) TypeInfo(ctx context.Context, typeID string) (*TypeInfo, error)
- func (r *Registry) Types(ctx context.Context) ([]TypeInfo, error)
- func (r *Registry) ValidateAction(ctx context.Context, act gadb.UIKActionV1) error
- func (r *Registry) ValidateDest(ctx context.Context, dest gadb.DestV1) error
- func (r *Registry) ValidateField(ctx context.Context, typeID, fieldID, value string) error
- type SearchOptions
- type SearchResult
- type TypeInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownType = validation.NewGenericError("unknown destination type") ErrUnsupported = errors.New("unsupported operation") ErrNotEnabled = validation.NewGenericError("destination type is not enabled") )
Functions ¶
This section is empty.
Types ¶
type ActionParamError ¶
func (*ActionParamError) ClientError ¶
func (e *ActionParamError) ClientError() bool
func (*ActionParamError) Error ¶
func (e *ActionParamError) Error() string
type ActionValidator ¶
type ActionValidator interface {
ValidateAction(ctx context.Context, act gadb.UIKActionV1) error
}
type Cursorable ¶
type DestArgError ¶
DestArgError is returned when a destination argument is invalid.
func (*DestArgError) ClientError ¶
func (e *DestArgError) ClientError() bool
func (*DestArgError) Error ¶
func (e *DestArgError) Error() string
type DestValidator ¶
type DisplayInfo ¶
func (DisplayInfo) IsInlineDisplayInfo ¶
func (DisplayInfo) IsInlineDisplayInfo()
type DynamicParamConfig ¶
type FieldConfig ¶
type FieldSearcher ¶
type FieldValue ¶
type Fieldable ¶
type Fieldable interface {
AsField() FieldValue
}
type MessageSender ¶
type MessageSender interface { // Send should return nil error if the notification was sent successfully. It should be expected // that a returned error means that the notification should be attempted again. // // If the sent message can have its status tracked, a unique externalID should be returned. SendMessage(context.Context, nfymsg.Message) (*nfymsg.SentMessage, error) }
A MessageSender can send notifications.
type MessageStatuser ¶
type MessageStatuser interface {
MessageStatus(ctx context.Context, externalID string) (*nfymsg.Status, error)
}
A MessageStatuser is an optional interface a Sender can implement that allows checking the status of a previously sent message by it's externalID.
type OptionFrommer ¶
type OptionFrommer interface {
FromNotifyOptions(context.Context, SearchOptions) error
}
type ParamValidator ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) DisplayInfo ¶
func (*Registry) FieldLabel ¶
func (*Registry) IsDynamicAction ¶
func (*Registry) LookupTypeName ¶
func (*Registry) MessageStatus ¶
func (*Registry) RegisterProvider ¶
func (*Registry) SearchField ¶
func (r *Registry) SearchField(ctx context.Context, typeID, fieldID string, options SearchOptions) (*SearchResult, error)
func (*Registry) SendMessage ¶
func (*Registry) StubNotifiers ¶
func (r *Registry) StubNotifiers()
StubNotifiers will cause all notifications senders to be stubbed out.
This causes all notifications to be marked as delivered, but not actually sent.
func (*Registry) ValidateAction ¶
func (*Registry) ValidateDest ¶
type SearchOptions ¶
type SearchResult ¶
type SearchResult struct { HasNextPage bool Cursor string Values []FieldValue }
func SearchByCursorFunc ¶
func SearchByCursorFunc[OptionType any, POptionType interface { *OptionType OptionFrommer }, Result Cursorable](ctx context.Context, opts SearchOptions, searchFn func(context.Context, *OptionType) ([]Result, error)) (*SearchResult, error)
func SearchByListFunc ¶
func SearchByListFunc[T Fieldable](ctx context.Context, searchOpts SearchOptions, listFn func(context.Context) ([]T, error)) (*SearchResult, error)
SearchByListFunc allows returning a SearchResult from a function that returns a list of Fieldable items.
type TypeInfo ¶
type TypeInfo struct { Type string Name string IconURL string IconAltText string Enabled bool RequiredFields []FieldConfig DynamicParams []DynamicParamConfig UserDisclaimer string // Message type info SupportsStatusUpdates bool SupportsAlertNotifications bool SupportsUserVerification bool SupportsOnCallNotify bool SupportsSignals bool UserVerificationRequired bool StatusUpdatesRequired bool }
func (TypeInfo) IsContactMethod ¶
func (TypeInfo) IsDynamicAction ¶
func (TypeInfo) IsEPTarget ¶
func (TypeInfo) IsSchedOnCallNotify ¶
Click to show internal directories.
Click to hide internal directories.