Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// LastCall specifies the call id from what you want to get new calls.
LastCall = "calls_since"
)
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(r *echo.Group, service Service, cService connection.Service, logger log.Logger)
RegisterHandlers sets up the routing of the HTTP handlers.
Types ¶
type ProceedData ¶
func (ProceedData) Validate ¶
func (p ProceedData) Validate() *response.Error
type Repository ¶
type Repository interface { // Get returns the call with the specified call ID. Get(ctx context.Context, appID, selfID, id string) (entity.Call, error) // Create saves a new call in the storage. Create(ctx context.Context, call *entity.Call) error // Update updates the call with given ID in the storage. Update(ctx context.Context, call entity.Call) error // Delete removes the call with given ID from the storage. Delete(ctx context.Context, appID, selfID, id string) error // Count returns the number of the calls records in the database. Count(ctx context.Context, aID, cID string, callsSince int) (int, error) // Query retrieves the calls records with the specified offset and limit from the database. Query(ctx context.Context, aID, cID string, callsSince int, offset, limit int) ([]entity.Call, error) }
Repository encapsulates the logic to access calls from the data source.
func NewRepository ¶
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository
NewRepository creates a new call repository
type Service ¶
type Service interface { Get(ctx context.Context, appID, recipient, callID string) (ExtCall, error) Start(ctx context.Context, appID, connectionID, callID string, data ProceedData) error Accept(ctx context.Context, appID, recipient, callID string, data ProceedData) error Busy(ctx context.Context, appID, recipient, callID string) error Stop(ctx context.Context, appID, recipient, callID string) error Setup(ctx context.Context, appID, recipient, name string) (*entity.Call, error) // Count returns the number of calls. Count(ctx context.Context, aID, cID string, callsSince int) (int, error) // Query returns the calls with the specified offset and limit. Query(ctx context.Context, aID, cID string, callsSince int, offset, limit int) ([]ExtCall, error) }
func NewService ¶
func NewService(repo Repository, runner support.SelfClientGetter, logger log.Logger) Service
Click to show internal directories.
Click to hide internal directories.