common errors as variable.

This commit is contained in:
Miroslav Šedivý
2021-08-29 17:09:13 +02:00
parent 530cc04805
commit 343b0c562a
17 changed files with 108 additions and 77 deletions

View File

@ -2,6 +2,7 @@ package types
import (
"context"
"errors"
"fmt"
"math"
"strings"
@ -12,6 +13,10 @@ import (
"demodesk/neko/internal/types/codec"
)
var (
ErrCapturePipelineAlreadyExists = errors.New("capture pipeline already exists")
)
type Sample media.Sample
type BroadcastManager interface {

View File

@ -1,5 +1,13 @@
package types
import "errors"
var (
ErrMemberAlreadyExists = errors.New("member already exists")
ErrMemberDoesNotExist = errors.New("member does not exist")
ErrMemberInvalidPassword = errors.New("invalid password")
)
type MemberProfile struct {
Name string `json:"name"`
IsAdmin bool `json:"is_admin"`

View File

@ -1,6 +1,16 @@
package types
import "net/http"
import (
"errors"
"net/http"
)
var (
ErrSessionNotFound = errors.New("session not found")
ErrSessionAlreadyExists = errors.New("session already exists")
ErrSessionAlreadyConnected = errors.New("session is already connected")
ErrSessionLoginDisabled = errors.New("session login disabled")
)
type SessionState struct {
IsConnected bool `json:"is_connected"`

View File

@ -1,6 +1,15 @@
package types
import "github.com/pion/webrtc/v3"
import (
"errors"
"github.com/pion/webrtc/v3"
)
var (
ErrWebRTCVideoNotFound = errors.New("webrtc video not found")
ErrWebRTCDataChannelNotFound = errors.New("webrtc data channel not found")
)
type ICEServer struct {
URLs []string `mapstructure:"urls" json:"urls"`