parrot

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedis        = fmt.Errorf("redis error")
	ErrCast         = fmt.Errorf("cast error")
	ErrMarshal      = fmt.Errorf("marshal error")
	ErrUnmarshal    = fmt.Errorf("unmarshal error")
	ErrNoSuchStream = fmt.Errorf("no such stream")
)

Functions

This section is empty.

Types

type Parrot

type Parrot struct {
	Redis redisParrotStorage
}

Parrot is a struct that stores packets and repeats them back to the repeater.

func NewParrot

func NewParrot(redis *redis.Client) *Parrot

NewParrot creates a new parrot instance.

func (*Parrot) GetStream

func (p *Parrot) GetStream(ctx context.Context, streamID uint) []models.Packet

GetStream returns the stream.

func (*Parrot) IsStarted

func (p *Parrot) IsStarted(ctx context.Context, streamID uint) bool

IsStarted returns true if the stream is already started.

func (*Parrot) RecordPacket

func (p *Parrot) RecordPacket(ctx context.Context, streamID uint, packet models.Packet)

RecordPacket records a packet from the stream.

func (*Parrot) StartStream

func (p *Parrot) StartStream(ctx context.Context, streamID uint, repeaterID uint) bool

StartStream starts a new stream.

func (*Parrot) StopStream

func (p *Parrot) StopStream(ctx context.Context, streamID uint)

StopStream stops a stream.

Jump to

Keyboard shortcuts

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