voicemaildb

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VoicemailCollection = "voicemails"

VoicemailCollection is the mongodb collection name.

Functions

This section is empty.

Types

type Database

type Database interface {
	Create(ctx context.Context, record *v1alpha.VoiceMailRecord) error
	Search(ctx context.Context, opt *SearchOptions) ([]v1alpha.VoiceMailRecord, error)
	UpdateSeenFlag(ctx context.Context, id string, seen bool) error
	ByID(ctx context.Context, id string) (*v1alpha.VoiceMailRecord, error)
}

Database defines the interface to create and search for voicemail records.

func NewWithClient

func NewWithClient(ctx context.Context, dbName string, cli *mongo.Client) (Database, error)

NewWithClient returns a new voicmaildb client.

type SearchOptions

type SearchOptions struct {
	dbutils.SimpleQueryBuilder
}

SearchOptions defines the criteria when searching for voicemail records.

func (*SearchOptions) ByCustomer

func (opts *SearchOptions) ByCustomer(source, id string) *SearchOptions

ByCustomer searches for voicemail records from the given customer.

func (*SearchOptions) ByDate

func (opts *SearchOptions) ByDate(d time.Time) *SearchOptions

ByDate only searches for voicemail records from the given date.

func (*SearchOptions) BySeen

func (opts *SearchOptions) BySeen(seen bool) *SearchOptions

BySeen only searches for voicemail records that match seen.

func (*SearchOptions) ByVoiceMail

func (opts *SearchOptions) ByVoiceMail(name string) *SearchOptions

ByVoiceMail searches for voicemail records that are stored in the specified voicemail.

type VoicemailEvent

type VoicemailEvent struct {
	VoiceMail      string             `json:"voiceMail,omitempty" bson:"voiceMail,omitempty"`
	From           string             `json:"from,omitempty" bson:"from,omitempty"`
	CustomerID     string             `json:"customerID,omitempty" bson:"customerID,omitempty"`
	CustomerSource string             `json:"customerSource,omitempty" bson:"customerSource,omitempty"`
	Read           bool               `json:"read,omitempty" bson:"read,omitempty"`
	ID             primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	CountUnread    int                `json:"countUnread" bson:"countUnread"`
}

VoiceMailEvent is fired when a voicemail message is read or unread.

Jump to

Keyboard shortcuts

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