events

package
v0.0.0-...-f491690 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(input <-chan cloudevents.Event, types ...string) <-chan cloudevents.Event

Filter is the filter for events.

func FilterFunc

func FilterFunc(types ...string) func(cloudevents.Event) bool

FilterFunc is the filter for events.

Types

type ChoiceResult

type ChoiceResult struct {
	// Label is the label of the choice.
	Label string `json:"label"`
}

ChoiceResult is the result for choice.

type CommunicationIdentifier

type CommunicationIdentifier struct {
	ID                string                      `json:"id,omitempty"`
	Kind              CommunicationIdentifierKind `json:"kind"`
	CommunicationUser *CommunicationUser          `json:"communicationUser,omitempty"`
	PhoneNumber       *PhonenumberIdentifier      `json:"phoneNumber,omitempty"`
}

CommunicationIdentifier is a communication user identifier.

type CommunicationIdentifierKind

type CommunicationIdentifierKind string

CommunicationIdentifierKind is the kind of the communication identifier.

const (
	// CommunicationIdentifierKindCommunicationUser is the communication user kind.
	CommunicationIdentifierKindCommunicationUser CommunicationIdentifierKind = "communicationUser"
	// CommunicationIdentifierKindPhoneNumber is the phone number kind.
	CommunicationIdentifierKindPhoneNumber CommunicationIdentifierKind = "phoneNumber"
)

type CommunicationUser

type CommunicationUser struct {
	ID string `json:"id"`
}

CommunicationUser is a communication user.

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

EventHandler is the handler for events.

func NewEventHandler

func NewEventHandler(opts ...Opt) *EventHandler

NewEventHandler creates a new event handler.

func (*EventHandler) Close

func (h *EventHandler) Close()

Close closes the events channel.

func (*EventHandler) Events

func (h *EventHandler) Events() <-chan cloudevents.Event

Events returns the events channel.

func (*EventHandler) ServeHTTP

func (h *EventHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the handler for events.

type MicrosoftCommunicationCallConnected

type MicrosoftCommunicationCallConnected struct {
	// Version is the version of the event.
	Version string `json:"version"`
	// CallConnectionID is the ID of the call connection.
	CallConnectionID string `json:"callConnectionId"`
	// ServerCallID is the ID of the server call.
	ServerCallID string `json:"serverCallId"`
	// CorrelationID is the ID of the correlation.
	CorrelationID string `json:"correlationId"`
	// PublicEventType is the type of the event.
	PublicEventType string `json:"publicEventType"`
}

MicrosoftCommunicationCallConnected is the data type of the event. This parses the data of the Microsoft.Communication.CallConnected event.

type MicrosoftCommunicationParticipantsUpdated

type MicrosoftCommunicationParticipantsUpdated struct {
	// Participants is the list of participants.
	Participants []Participant `json:"participants"`
	// SequenceNumber is the sequence number.
	SequenceNumber int `json:"sequenceNumber"`
	// Version is the version of the event.
	Version string `json:"version"`
	// CallConnectionID is the ID of the call connection.
	CallConnectionID string `json:"callConnectionId"`
	// ServerCallID is the ID of the server call.
	ServerCallID string `json:"serverCallId"`
	// CorrelationID is the ID of the correlation.
	CorrelationID string `json:"correlationId"`
	// PublicEventType is the type of the event.
	PublicEventType string `json:"publicEventType"`
}

MicrosoftCommunicationParticipantsUpdated is the data type of the event. This parses the data of the Microsoft.Communication.ParticipantsUpdate event.

type MicrosoftCommunicationRecognizeCompleted

type MicrosoftCommunicationRecognizeCompleted struct {
	// RecognitionType is the type of recognition.
	RecognitionType RecognizeInputType `json:"recognitionType"`
	// ChoiceResult is the result of choice.
	ChoiceResult *ChoiceResult `json:"choiceResult,omitempty"`
	// Version is the version of the event.
	Version string `json:"version"`
	// ResultInformation is the information of the result.
	ResultInformation *ResultInformation `json:"resultInformation,omitempty"`
	// CallConnectionID is the ID of the call connection.
	CallConnectionID string `json:"callConnectionId"`
	// ServerCallID is the ID of the server call.
	ServerCallID string `json:"serverCallId"`
	// CorrelationID is the ID of the correlation.
	CorrelationID string `json:"correlationId"`
	// PublicEventType is the type of the event.
	PublicEventType string `json:"publicEventType"`
}

MicrosoftCommunicationRecognizeCompleted is the data type of the event. This parses the data of the Microsoft.Communication.RecognizeCompleted event.

type Opt

type Opt func(*EventHandler)

Opt is the option for event handler.

func WithBufferSize

func WithBufferSize(size int) Opt

WithBufferSize sets the buffer size for the events channel.

func WithEvents

func WithEvents(events chan cloudevents.Event) Opt

WithEvents sets the events channel.

type Participant

type Participant struct {
	// Identifier is the identifier of the participant.
	Identifier CommunicationIdentifier `json:"identifier"`
	// IsMuted is the flag of the participant.
	IsMuted bool `json:"isMuted"`
	// IsOnHold is the flag of the participant.
	IsOnHold bool `json:"isOnHold"`
}

Participant is the participant.

type PhonenumberIdentifier

type PhonenumberIdentifier struct {
	// ID is the id
	ID string `json:"id"`
	// Value is the value.
	Value string `json:"value"`
}

PhonenumberIdentifier is the phone number identifier.

type RecognizeInputType

type RecognizeInputType string

RecognizeInputType is the type of input for recognizing call.

const (
	// RecognizeInputTypeChoices is the type of input for recognizing call.
	RecognizeInputTypeChoices RecognizeInputType = "choices"
	// RecognizeInputTypeDtmf is the type of input for recognizing call.
	RecognizeInputTypeDtmf RecognizeInputType = "dtmf"
	// RecognizeInputTypeSpeech is the type of input for recognizing call.
	RecognizeInputTypeSpeech RecognizeInputType = "speech"
	// RecognizeInputTypeSpeechOrDtmf is the type of input for recognizing call.
	RecognizeInputTypeSpeechOrDtmf RecognizeInputType = "speechOrDtmf"
)

type ResultInformation

type ResultInformation struct {
	// Code is the code of the result.
	Code int `json:"code"`
	// SubCode is the sub code of the result.
	SubCode int `json:"subCode"`
	// Message is the message of the result.
	Message string `json:"message"`
}

ResultInformation is the information for result.

Jump to

Keyboard shortcuts

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