room

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package room provides utilities for working with LiveKit rooms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides room management operations.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new room client.

func (*Client) CreateRoom

func (c *Client) CreateRoom(ctx context.Context, name string) (*livekit.Room, error)

CreateRoom creates a new room.

func (*Client) DeleteRoom

func (c *Client) DeleteRoom(ctx context.Context, name string) error

DeleteRoom deletes a room.

func (*Client) GenerateAgentToken

func (c *Client) GenerateAgentToken(roomName, identity, name string) (string, error)

GenerateAgentToken creates a token for the AI agent to join a room.

func (*Client) GenerateClientToken

func (c *Client) GenerateClientToken(roomName, identity, name string) (string, error)

GenerateClientToken creates a token for a client to join a room.

func (*Client) GenerateToken

func (c *Client) GenerateToken(opts TokenOptions) (string, error)

GenerateToken creates a JWT token for joining a room.

func (*Client) ListParticipants

func (c *Client) ListParticipants(ctx context.Context, roomName string) ([]*livekit.ParticipantInfo, error)

ListParticipants lists participants in a room.

func (*Client) ListRooms

func (c *Client) ListRooms(ctx context.Context) ([]*livekit.Room, error)

ListRooms lists all rooms.

type Config

type Config struct {
	APIKey    string
	APISecret string
	URL       string
}

Config configures room creation and token generation.

type TokenOptions

type TokenOptions struct {
	Identity   string
	Name       string
	RoomName   string
	CanPublish bool
	TTL        time.Duration
	Metadata   string
}

TokenOptions configures token generation.

Jump to

Keyboard shortcuts

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