telemost

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

README

Coverage Status Codacy badge GitHub Actions CI Status GitHub Actions CodeQL Status

Usage exampleCI StatusContributingLicense


telemost is client for Yandex.Telemost API.

Usage example

package main

import (
  "fmt"

  "github.com/essentialkaos/telemost"
)

func main() {
  api, err := crowd.NewClient("myToken1234")

  if err != nil {
    fmt.Println(err)
    return
  }

  // Create new conference
  cnf, err := api.Create(&telemost.Conference{})

  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Printf("Conference %s created, join — %s\n", cnf.ID, cnf.JoinURL)
}

CI Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0

Documentation

Index

Constants

View Source
const (
	ROOM_LEVEL_PUBLIC  = "PUBLIC"
	ROOM_LEVEL_ORG     = "ORGANIZATION"
	ROOM_LEVEL_ADMINS  = "ADMINS"
	ROOM_LEVEL_UNKNOWN = "UNKNOWN"
)
View Source
const (
	ACCESS_LEVEL_PUBLIC  = "PUBLIC"
	ACCESS_LEVEL_ORG     = "ORGANIZATION"
	ACCESS_LEVEL_UNKNOWN = "UNKNOWN"
)

Variables

View Source
var (
	ErrEmptyToken    = fmt.Errorf("Token is empty")
	ErrEmptyID       = fmt.Errorf("Conference ID is empty")
	ErrEmptyCohosts  = fmt.Errorf("Cohosts slice is empty")
	ErrNilClient     = fmt.Errorf("Client is nil")
	ErrNilConference = fmt.Errorf("Conference is nil")
)
View Source
var API = "https://cloud-api.yandex.net/v1/telemost-api/conferences"

API is URL of Yandex.Telemost API

Functions

This section is empty.

Types

type Client

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

Client is Yandex.Telemost API client

func NewClient

func NewClient(token string) (*Client, error)

NewClient creates new client instance

func (*Client) AddCohosts

func (c *Client) AddCohosts(id string, cohosts []string) error

AddCohosts appends given hosts to conference cohosts

https://yandex.ru/dev/telemost/doc/ru/cohosts-add

func (*Client) Create

func (c *Client) Create(conf *Conference) (*ConferenceInfo, error)

Create creates new conference or broadcast

https://yandex.ru/dev/telemost/doc/ru/conference-create

func (*Client) Delete

func (c *Client) Delete(id string) error

Delete cancels conference or broadcast

func (*Client) DeleteCohosts

func (c *Client) DeleteCohosts(id string, cohosts []string) error

DeleteCohosts removes given hosts from chosts of conference

https://yandex.ru/dev/telemost/doc/ru/cohosts-del

func (*Client) Get

func (c *Client) Get(id string) (*ConferenceInfo, error)

Get fetches info about conference or broadcast

https://yandex.ru/dev/telemost/doc/ru/conference-read

func (*Client) GetCohosts

func (c *Client) GetCohosts(id string) (Hosts, error)

GetCohosts fetches slice with all cohosts

https://yandex.ru/dev/telemost/doc/ru/cohosts-read

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(app, version string)

SetUserAgent sets client user agent

func (*Client) Update

func (c *Client) Update(id string, conf *Conference) (*ConferenceInfo, error)

Update updates conference or broadcast

https://yandex.ru/dev/telemost/doc/ru/conference-update

func (*Client) UpdateCohosts

func (c *Client) UpdateCohosts(id string, cohosts []string) error

UpdateCohosts updates conference cohosts

https://yandex.ru/dev/telemost/doc/ru/cohosts-update

type Conference

type Conference struct {
	WaitingRoomLevel string      `json:"waiting_room_level,omitempty"`
	LiveStream       *LiveStream `json:"live_stream,omitempty"`
	CoHosts          Hosts       `json:"cohosts,omitempty"`
}

Conference contains basic info about conference

type ConferenceInfo

type ConferenceInfo struct {
	Conference
	ID             string `json:"id"`
	JoinURL        string `json:"join_url"`
	SIPURIMeeting  string `json:"sip_uri_meeting"`
	SIPURITelemost string `json:"sip_uri_telemost"`
	SIPID          string `json:"sip_id"`
}

ConferenceInfo contains information about an existing conference

type Host

type Host struct {
	Email string `json:"email"`
}

Host contains info about host

type Hosts

type Hosts []*Host

Hosts is a slice with hosts

func (Hosts) Flatten

func (h Hosts) Flatten() []string

Flatten converts slice of hosts to slice with emails

type LiveStream

type LiveStream struct {
	WatchURL    string `json:"watch_url"`
	AccessLevel string `json:"access_level"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

LiveStream contains info about conference stream

Jump to

Keyboard shortcuts

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