Add TwirpRequestStatusReporter twirp server hook to count requests (#1309)

This commit is contained in:
Benjamin Pracht
2023-01-18 11:53:20 -08:00
committed by GitHub
parent bccf7a6842
commit edc39da0b1
7 changed files with 120 additions and 25 deletions
+16 -14
View File
@@ -1,19 +1,21 @@
package service
import "errors"
import (
"github.com/livekit/psrpc"
)
var (
ErrEgressNotFound = errors.New("egress does not exist")
ErrEgressNotConnected = errors.New("egress not connected (redis required)")
ErrIdentityEmpty = errors.New("identity cannot be empty")
ErrIngressNotConnected = errors.New("ingress not connected (redis required)")
ErrIngressNotFound = errors.New("ingress does not exist")
ErrMetadataExceedsLimits = errors.New("metadata size exceeds limits")
ErrOperationFailed = errors.New("operation cannot be completed")
ErrParticipantNotFound = errors.New("participant does not exist")
ErrRoomNotFound = errors.New("requested room does not exist")
ErrRoomLockFailed = errors.New("could not lock room")
ErrRoomUnlockFailed = errors.New("could not unlock room, lock token does not match")
ErrTrackNotFound = errors.New("track is not found")
ErrWebHookMissingAPIKey = errors.New("api_key is required to use webhooks")
ErrEgressNotFound = psrpc.NewErrorf(psrpc.NotFound, "egress does not exist")
ErrEgressNotConnected = psrpc.NewErrorf(psrpc.Internal, "egress not connected (redis required)")
ErrIdentityEmpty = psrpc.NewErrorf(psrpc.InvalidArgument, "identity cannot be empty")
ErrIngressNotConnected = psrpc.NewErrorf(psrpc.Internal, "ingress not connected (redis required)")
ErrIngressNotFound = psrpc.NewErrorf(psrpc.NotFound, "ingress does not exist")
ErrMetadataExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "metadata size exceeds limits")
ErrOperationFailed = psrpc.NewErrorf(psrpc.Internal, "operation cannot be completed")
ErrParticipantNotFound = psrpc.NewErrorf(psrpc.NotFound, "participant does not exist")
ErrRoomNotFound = psrpc.NewErrorf(psrpc.NotFound, "requested room does not exist")
ErrRoomLockFailed = psrpc.NewErrorf(psrpc.Internal, "could not lock room")
ErrRoomUnlockFailed = psrpc.NewErrorf(psrpc.Internal, "could not unlock room, lock token does not match")
ErrTrackNotFound = psrpc.NewErrorf(psrpc.NotFound, "track is not found")
ErrWebHookMissingAPIKey = psrpc.NewErrorf(psrpc.InvalidArgument, "api_key is required to use webhooks")
)