Documentation ¶
Index ¶
- Variables
- func BSONToMessage(document bson.Raw, msg proto.Message, id *string) error
- func MessageToBSON(id string, msg proto.Message) (bson.M, error)
- type CustomerResolver
- type Database
- type MailboxDatabase
- type QueryOption
- type SearchQuery
- func (q *SearchQuery) After(d time.Time) *SearchQuery
- func (q *SearchQuery) AtDate(d time.Time) *SearchQuery
- func (q *SearchQuery) Before(d time.Time) *SearchQuery
- func (q *SearchQuery) Between(start, end time.Time) *SearchQuery
- func (q *SearchQuery) Caller(number *phonenumbers.PhoneNumber) *SearchQuery
- func (q *SearchQuery) CallerString(number string) *SearchQuery
- func (q *SearchQuery) Customer(id string) *SearchQuery
- func (q *SearchQuery) InboundNumber(number *phonenumbers.PhoneNumber) *SearchQuery
- func (q *SearchQuery) InboundNumberString(number string) *SearchQuery
- func (q *SearchQuery) TransferTarget(t string) *SearchQuery
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func BSONToMessage ¶ added in v1.4.1
Types ¶
type CustomerResolver ¶ added in v1.3.0
type CustomerResolver struct {
// contains filtered or unexported fields
}
func NewCustomerResolver ¶ added in v1.3.0
func NewCustomerResolver(db Database, cli customerv1connect.CustomerServiceClient) *CustomerResolver
func (*CustomerResolver) Query ¶ added in v1.3.0
func (cr *CustomerResolver) Query(ctx context.Context, query *SearchQuery) ([]*pbx3cxv1.CallEntry, []*customerv1.Customer, error)
type Database ¶
type Database interface { // CreateUnidentified creates new "unidentified" calllog record where // we don't know the caller. CreateUnidentified(ctx context.Context, log structs.CallLog) error // RecordCustomerCall records a call that has been associated with a customer. // When called, RecordCustomerCall searches for an "unidentified" calllog that // was recorded at the same time and replaces that entry. RecordCustomerCall(ctx context.Context, record structs.CallLog) error // Search searches for all records that match query. Search(ctx context.Context, query *SearchQuery) ([]structs.CallLog, error) Search2(ctx context.Context, opts ...QueryOption) ([]structs.CallLog, error) StreamSearch(ctx context.Context, query *SearchQuery) (<-chan structs.CallLog, <-chan error) FindDistinctNumbersWithoutCustomers(ctx context.Context) ([]string, error) UpdateUnmatchedNumber(ctx context.Context, number string, customerId string) error }
Database supports storing and retrieving of calllog records.
type MailboxDatabase ¶ added in v1.4.1
type MailboxDatabase interface { CreateMailbox(ctx context.Context, mailbox *pbx3cxv1.Mailbox) error ListMailboxes(ctx context.Context) ([]*pbx3cxv1.Mailbox, error) GetMailbox(ctx context.Context, id string) (*pbx3cxv1.Mailbox, error) DeleteMailbox(ctx context.Context, id string) error AppendNotificationSetting(ctx context.Context, mailbox string, nfs *pbx3cxv1.NotificationSettings) error DeleteNotificationSetting(ctx context.Context, mailbox, name string) error UpdateMailbox(ctx context.Context, mb *pbx3cxv1.Mailbox) error UpdateUnmatchedNumber(ctx context.Context, number string, customerId string) error FindDistinctNumbersWithoutCustomers(ctx context.Context) ([]string, error) CreateVoiceMail(ctx context.Context, voicemail *pbx3cxv1.VoiceMail) error ListVoiceMails(ctx context.Context, mailbox string, query *pbx3cxv1.VoiceMailFilter) ([]*pbx3cxv1.VoiceMail, error) MarkVoiceMails(ctx context.Context, seen bool, mailbox string, ids []string) error GetVoicemail(ctx context.Context, id string) (*pbx3cxv1.VoiceMail, error) mailsync.Store }
func NewMailboxDatabase ¶ added in v1.4.1
type QueryOption ¶ added in v1.4.1
type QueryOption func(*query)
func WithAgent ¶ added in v1.4.1
func WithAgent(t string) QueryOption
func WithCaller ¶ added in v1.4.1
func WithCaller(t string) QueryOption
func WithFrom ¶ added in v1.4.1
func WithFrom(t time.Time) QueryOption
func WithInbound ¶ added in v1.4.1
func WithInbound() QueryOption
func WithOutbound ¶ added in v1.4.1
func WithOutbound() QueryOption
func WithTo ¶ added in v1.4.1
func WithTo(t time.Time) QueryOption
type SearchQuery ¶
type SearchQuery struct {
dbutils.SimpleQueryBuilder
}
SearchQuery searches for calllog records that match the specified query.
func (*SearchQuery) After ¶
func (q *SearchQuery) After(d time.Time) *SearchQuery
After matches all calllog records that happened after d.
func (*SearchQuery) AtDate ¶
func (q *SearchQuery) AtDate(d time.Time) *SearchQuery
AtDate searches for all calllog records that happened at the day d.
func (*SearchQuery) Before ¶
func (q *SearchQuery) Before(d time.Time) *SearchQuery
Before matches all records that happened before d.
func (*SearchQuery) Between ¶
func (q *SearchQuery) Between(start, end time.Time) *SearchQuery
Between matches all records that were created before start - end.
func (*SearchQuery) Caller ¶
func (q *SearchQuery) Caller(number *phonenumbers.PhoneNumber) *SearchQuery
Caller matches all records where match the caller number.
func (*SearchQuery) CallerString ¶
func (q *SearchQuery) CallerString(number string) *SearchQuery
CallerString matches all records where the caller exactly matches number. Use Caller() if you want to match regardless of the number format.
func (*SearchQuery) Customer ¶
func (q *SearchQuery) Customer(id string) *SearchQuery
Customer matches all records that are associated with customer.
func (*SearchQuery) InboundNumber ¶
func (q *SearchQuery) InboundNumber(number *phonenumbers.PhoneNumber) *SearchQuery
InboundNumber matches all records where the inbound-number matches number.
func (*SearchQuery) InboundNumberString ¶
func (q *SearchQuery) InboundNumberString(number string) *SearchQuery
InboundNumberString matches all records where the inbound-number exactly matches number. Use InboundNumber() if you want to match regardless of the number format.
func (*SearchQuery) TransferTarget ¶
func (q *SearchQuery) TransferTarget(t string) *SearchQuery
TransferTarget matches the transfer target of the +call.