Documentation ¶
Overview ¶
Package eyeson provides a client to interact with the eyeson video API to start video meetings, create access for participants, control recordings, add media like overlay images, play videos, start and stop broadcasts, send chat messages or assign participants to various layouts.
Index ¶
- Constants
- type Broadcast
- type BroadcastUpdate
- type Chat
- type Client
- type ClientOption
- type EventBase
- type EventInterface
- type EventRoom
- type EventUser
- type Links
- type ObserverService
- type Options
- type OptionsUpdate
- type Participant
- type ParticipantUpdate
- type Playback
- type PlaybackUpdate
- type PodiumPosition
- type PodiumUpdate
- type Recording
- type RecordingUpdate
- type Room
- type RoomLinks
- type RoomResponse
- func (rr *RoomResponse) GetAuthToken() string
- func (rr *RoomResponse) GetClientID() string
- func (rr *RoomResponse) GetConfID() string
- func (rr *RoomResponse) GetDisplayname() string
- func (rr *RoomResponse) GetSigEndpoint() string
- func (rr *RoomResponse) GetStunServers() []string
- func (rr *RoomResponse) GetTurnServerPassword() string
- func (rr *RoomResponse) GetTurnServerURLs() []string
- func (rr *RoomResponse) GetTurnServerUsername() string
- type RoomUpdate
- type RoomsService
- type SIP
- type SeppSignaling
- type Signaling
- type Snapshot
- type SnapshotUpdate
- type TurnServer
- type User
- type UserService
- func (u *UserService) Chat(content string) error
- func (u *UserService) ClearLayer(zIndex int) error
- func (u *UserService) SetLayer(imgURL string, zIndex int) error
- func (u *UserService) SetLayout(layout string, users []string, voiceActivation, showNames bool) error
- func (u *UserService) StartBroadcast(streamURL string) error
- func (u *UserService) StartPlayback(playbackURL string, userID string) error
- func (u *UserService) StartRecording() error
- func (u *UserService) StopBroadcast() error
- func (u *UserService) StopMeeting() error
- func (u *UserService) StopRecording() error
- func (u *UserService) WaitReady() error
- type Webhook
- type WebhookDetails
- type WebhookService
Constants ¶
const Background int = -1
Background provides the z-index to represent a background image.
const Foreground int = 1
Foreground provides the z-index to represent a foreground image.
const Timeout int = 180
Timeout provides the maximum number of seconds WaitReady will wait for a meeting and user to be ready.
const WEBHOOK_RECORDING string = "recording_update"
const WEBHOOK_ROOM string = "room_update"
const WEBHOOK_SNAPSHOT string = "snapshot_update"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcast ¶ added in v1.3.0
type Broadcast struct { ID string `json:"id"` Platform string `json:"platform"` PlayerURL string `json:"player_url"` User EventUser `json:"user"` Room EventRoom `json:"room"` }
Broadcast contains information of a live-stream broadcast.
type BroadcastUpdate ¶ added in v1.3.0
BroadcastUpdate event is sent whenever the live-stream broadcasts changes.
type Chat ¶ added in v1.3.0
type Chat struct { EventBase Content string `json:"content"` ClientID string `json:"cid"` UserID string `json:"user_id"` CreatedAt time.Time `json:"created_at"` }
Chat contains a chat message.
type Client ¶
type Client struct { BaseURL *url.URL Rooms *RoomsService Webhook *WebhookService Observer *ObserverService // contains filtered or unexported fields }
Client provides methods to communicate with the eyeson API, starting video meetings, adapt configurations and send chat, images, presentations and videos to the meeting.
func NewClient ¶
func NewClient(key string, options ...ClientOption) (*Client, error)
NewClient creates a new client in order to send requests to the eyeson API.
func (*Client) Do ¶
Do sends a request to the eyeson API and prepares the result from the received response.
func (*Client) NewRequest ¶
NewRequest prepares a request to be sent to the API.
func (*Client) UserClient ¶
UserClient provides a client for user requests that use the session access key for authorization.
type ClientOption ¶ added in v1.2.4
type ClientOption func(*Client)
ClientOption interface to specify options for client
func WithCustomCAFile ¶ added in v1.2.4
func WithCustomCAFile(customCAFile string) ClientOption
WithCustomCAFile Set a custom CA file to be used instead of the system-poool CAs.
func WithCustomEndpoint ¶ added in v1.3.0
func WithCustomEndpoint(endpoint string) ClientOption
WithCustomEndpoint Set an endpoint which differs from the official api endpoint.
type EventBase ¶ added in v1.3.0
type EventBase struct {
Type string `json:"type"`
}
EventBase Base for all events. Has only the type field.
type EventInterface ¶ added in v1.3.0
type EventInterface interface {
GetType() string
}
EventInterface interface for all event-messages.
type EventRoom ¶ added in v1.3.0
type EventRoom struct { ID string `json:"id"` Name string `json:"name"` Ready bool `json:"ready"` StartedAt time.Time `json:"started_at"` Shutdown bool `json:"shutdown"` GuestToken string `json:"guest_token"` Options Options `json:"options"` Participants []Participant `json:"participants"` Broadcasts []Broadcast `json:"broadcasts"` }
EventRoom represents the room.
type EventUser ¶ added in v1.3.0
type EventUser struct { ID string `json:"id"` Name string `json:"name"` Guest bool `json:"guest"` Avatar string `json:"avatar"` JoinedAt time.Time `json:"joined_at"` }
EventUser represents an user within the event messages.
type ObserverService ¶ added in v1.3.0
type ObserverService service
ObserverService Service to listen and control a room.
func (*ObserverService) Connect ¶ added in v1.3.0
func (os *ObserverService) Connect(ctx context.Context, roomID string) (<-chan EventInterface, error)
Connect connects the observer and returns an eventInterface channel on success.
type Options ¶ added in v1.3.0
type Options struct {
ShowNames bool `json:"show_names"`
}
Options Struct containing list of options of the room.
type OptionsUpdate ¶ added in v1.3.0
OptionsUpdate event is sent whenever an option parameter is modified or added via the rest-interface.
type Participant ¶ added in v1.3.0
type Participant struct { ID string `json:"id"` RoomID string `json:"room_id"` Name string `json:"name"` Guest bool `json:"guest"` Online bool `json:"online"` Avatar string `json:"avatar"` }
Participant holds informationof a participating user containing its online status.
type ParticipantUpdate ¶ added in v1.3.0
type ParticipantUpdate struct { EventBase Participant Participant `json:"participant"` }
ParticipantUpdate event is sent whenever the list of participants changes.
type Playback ¶ added in v1.3.0
type Playback struct { URL string `json:"url"` PlayID string `json:"play_id"` Audio bool `json:"audio"` }
Playback represents a playback i.e. media inject into the confserver.
type PlaybackUpdate ¶ added in v1.3.0
PlaybackUpdate Sent when a playback was started.
type PodiumPosition ¶ added in v1.3.0
type PodiumPosition struct { UserID string `json:"user_id"` PlayID *string `json:"play_id"` Width int `json:"width"` Height int `json:"height"` Left int `json:"left"` Top int `json:"top"` ZIndex int `json:"z-index"` }
PodiumPosition defines an area on the podium wich belongs to the specified user identified by its user-id.
type PodiumUpdate ¶ added in v1.3.0
type PodiumUpdate struct { EventBase Podium []PodiumPosition `json:"podium"` }
PodiumUpdate event is sent whenever the podium layout or the positioning of participants changes.
type Recording ¶ added in v1.3.0
type Recording struct { ID string `json:"id"` // Unix timestamp CreatedAt int `json:"created_at"` Duration *int `json:"duration"` Links Links `json:"links"` User EventUser `json:"user"` Room EventRoom `json:"room"` }
Recording holds information on a recording.
type RecordingUpdate ¶ added in v1.3.0
RecordingUpdate event is sent whenver recording is started or stopped.
type Room ¶
type Room struct { ID string `json:"id"` GuestToken string `json:"guest_token"` SIP SIP `json:"sip"` Shutdown bool `json:"shutdown"` }
Room has attributes for SIP details and GuestToken
type RoomLinks ¶
type RoomLinks struct { Gui string `json:"gui"` GuestJoin string `json:"guest_join"` Websocket string `json:"websocket"` }
RoomLinks provide all public web URLs for a room.
type RoomResponse ¶
type RoomResponse struct { AccessKey string `json:"access_key"` Links RoomLinks `json:"links"` Room Room `json:"room"` User User `json:"user"` Ready bool `json:"ready"` Signaling Signaling `json:"signaling"` }
RoomResponse holds available attributes to a room.
func (*RoomResponse) GetAuthToken ¶ added in v1.2.1
func (rr *RoomResponse) GetAuthToken() string
GetAuthToken returns the JWT-Authtoken for authenticating to the sig-service.
func (*RoomResponse) GetClientID ¶ added in v1.2.1
func (rr *RoomResponse) GetClientID() string
GetClientID returns the client-id of this signaling entity.
func (*RoomResponse) GetConfID ¶ added in v1.2.1
func (rr *RoomResponse) GetConfID() string
GetConfID returns the conf-id to connect to.
func (*RoomResponse) GetDisplayname ¶ added in v1.2.1
func (rr *RoomResponse) GetDisplayname() string
func (*RoomResponse) GetSigEndpoint ¶ added in v1.2.1
func (rr *RoomResponse) GetSigEndpoint() string
GetSigEndpoint returns the signaling endpoint
func (*RoomResponse) GetStunServers ¶ added in v1.2.1
func (rr *RoomResponse) GetStunServers() []string
GetStunServers returns stun info
func (*RoomResponse) GetTurnServerPassword ¶ added in v1.2.1
func (rr *RoomResponse) GetTurnServerPassword() string
GetTurnServerPassword returns turn credentials
func (*RoomResponse) GetTurnServerURLs ¶ added in v1.2.1
func (rr *RoomResponse) GetTurnServerURLs() []string
GetTurnServerURLs returns turn info
func (*RoomResponse) GetTurnServerUsername ¶ added in v1.2.1
func (rr *RoomResponse) GetTurnServerUsername() string
GetTurnServerUsername return turn credentials
type RoomUpdate ¶ added in v1.3.0
RoomUpdate event is sent if any of the room properties is changed.
type RoomsService ¶
type RoomsService service
RoomsService provides method Join to start and join a room.
func (*RoomsService) GuestJoin ¶ added in v1.2.0
func (srv *RoomsService) GuestJoin(guestToken, id, name, avatar string) (*UserService, error)
GuestJoin creates a new guest user for an active meeting.
func (*RoomsService) Join ¶
func (srv *RoomsService) Join(id string, user string, options map[string]string) (*UserService, error)
Join starts and joins a video meeting. The user string represents a unique identifier, to join as participant. If the same room identifier is provided the participants will join the same meeting. The room identifier can be omitted, the eyeson-api will therefor create a new room for every user joining.
func (*RoomsService) Shutdown ¶ added in v1.1.1
func (srv *RoomsService) Shutdown(id string) error
Shutdown force stops a running meeting.
type SIP ¶
type SIP struct { URI string `json:"uri"` Domain string `json:"domain"` AuthorizationUser string `json:"authorizationUser"` Password string `json:"password"` WSServers string `json:"wsServers"` DisplayName string `json:"displayName"` }
SIP contains access details for the protocol used to establish a connection.
type SeppSignaling ¶ added in v1.2.1
type SeppSignaling struct { ClientID string `json:"client_id"` AuthToken string `json:"auth_token"` ConfID string `json:"conf_id"` Endpoint string `json:"endpoint"` StunServers []string `json:"stun_servers"` TurnServer []TurnServer `json:"turn_servers"` }
SeppSignaling holds information required by the gosepp signaling interface.
type Signaling ¶ added in v1.2.1
type Signaling struct { Type string `json:"type"` SigSepp SeppSignaling `json:"options"` }
Signaling base container for signaling options. So far only type "sepp" is allowed.
type Snapshot ¶ added in v1.3.0
type Snapshot struct { ID string `json:"id"` Name string `json:"name"` Links Links `json:"links"` Creator EventUser `json:"creator"` CreatedAt time.Time `json:"created_at"` Room EventRoom `json:"room"` }
Snapshot represents a snapshot
type SnapshotUpdate ¶ added in v1.3.0
SnapshotUpdate fired whenever a new snapshot ist taken.
type TurnServer ¶ added in v1.2.1
type TurnServer struct { URLs []string `json:"urls"` Username string `json:"username"` Password string `json:"password"` }
TurnServer provides connection info for ICE-Servers
type UserService ¶
type UserService struct { Data *RoomResponse // contains filtered or unexported fields }
UserService provides methods a user can perform.
func (*UserService) Chat ¶
func (u *UserService) Chat(content string) error
Chat sends a chat message.
func (*UserService) ClearLayer ¶
func (u *UserService) ClearLayer(zIndex int) error
ClearLayer clears a layer given by the z-index that should be set using the constants Foreground or Background.
func (*UserService) SetLayer ¶
func (u *UserService) SetLayer(imgURL string, zIndex int) error
SetLayer sets a layer image using the given public available URL pointing to an image file. The z-index should be set using the constants Foreground or Background.
func (*UserService) SetLayout ¶
func (u *UserService) SetLayout(layout string, users []string, voiceActivation, showNames bool) error
SetLayout sets a participant podium layout where the layout is either "custom" or "auto". The users list is of user-ids or empty strings for empty participant positions. The flag voiceActivation replaces participants actively by voice detection. The flag showNames show or hides participant name overlays.
func (*UserService) StartBroadcast ¶
func (u *UserService) StartBroadcast(streamURL string) error
StartBroadcast starts a broadcast to the given stream url given by a streaming service like YouTube, Vimeo, and others.
func (*UserService) StartPlayback ¶
func (u *UserService) StartPlayback(playbackURL string, userID string) error
StartPlayback starts a playback using the given public available URL to a video file. The given user id marks the position of the participant that is going to be replaced while the playback is shown.
func (*UserService) StartRecording ¶
func (u *UserService) StartRecording() error
StartRecording starts a recording.
func (*UserService) StopBroadcast ¶
func (u *UserService) StopBroadcast() error
StopBroadcast stops a broadcast.
func (*UserService) StopMeeting ¶
func (u *UserService) StopMeeting() error
StopMeeting stops a meeting for all participants.
func (*UserService) StopRecording ¶
func (u *UserService) StopRecording() error
StopRecording stops a recording.
func (*UserService) WaitReady ¶
func (u *UserService) WaitReady() error
WaitReady waits until a meeting has successfully been started. It has a fixed polling interval of one second. WaitReady responds with an error on timeout or any communication problems.
type Webhook ¶ added in v1.1.0
type Webhook struct { Type string `json:"type"` Recording struct { Id string `json:"id"` Duration int `json:"duration"` CreatedAt int `json:"created_at"` Links struct { Download string `json:"download"` } `json:"links"` Room struct { Id string `json:"id"` } } `json:"recording,omitempty"` Room struct { Id string `json:"id"` Name string `json:"name"` StartedAt time.Time `json:"started_at"` Shutdown bool `json:"shutdown"` } `json:"room"` Snapshot struct { Id string `json:"id"` Name string `json:"name"` CreatedAt time.Time `json:"created_at"` Links struct { Download string `json:"download"` } `json:"links"` Room struct { Id string `json:"id"` } } `json:"snapshot,omitempty"` }
Webhook holds available attributes to a room.
type WebhookDetails ¶ added in v1.1.0
type WebhookDetails struct { Id string `json:"id"` Url string `json:"url"` Types []string `json:"types"` LastRequestSentAt time.Time `json:"last_request_sent_at"` LastResponseCode string `json:"last_response_code"` }
WebhookDetails provide configuration details.
type WebhookService ¶ added in v1.1.0
type WebhookService service
WebhookService provides method Register and Unregister a webhook.
func (*WebhookService) Get ¶ added in v1.1.0
func (srv *WebhookService) Get() (*WebhookDetails, error)
Get provides details about a registered webhook.
func (*WebhookService) Register ¶ added in v1.1.0
func (srv *WebhookService) Register(endpoint, types string) error
Register will assign an endpoint URL to the current ApiKey.
func (*WebhookService) Unregister ¶ added in v1.1.0
func (srv *WebhookService) Unregister() error
Unregister will clear the current webhook.