relay

package
v0.0.0-...-f0b9b21 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Anime domain.AnimeBase
	Err   error
}

func (Error) Error

func (e Error) Error() string

type Relay

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

func NewRelay

func NewRelay(
	irc *irc.IRC,
	queue *queue.Queue,
	services lifecycle.ServiceLifecycle,
	fs *fs.FileSystem,
) (r *Relay)

func (*Relay) Connect

func (r *Relay) Connect() error

Connect starts up the IRC connection

func (*Relay) Connected

func (r *Relay) Connected() bool

Connected outputs if an IRC is connected

func (*Relay) ContainsTitle

func (r *Relay) ContainsTitle(title string) bool

ContainsTitle will return a boolean if the title is currently in the active item list within the queue.

func (*Relay) Disconnect

func (r *Relay) Disconnect()

Disconnect closes the the IRC along with the Queue

func (*Relay) L

func (r *Relay) L(ctx context.Context) *zap.Logger

L is a scoped logger for Relay.

func (*Relay) OnError

func (r *Relay) OnError(fn irc.OnError)

OnError is a proxy method to `irc.OnError`

func (*Relay) OnUpdate

func (r *Relay) OnUpdate(fn func(Update))

func (*Relay) PushBack

func (r *Relay) PushBack(anime domain.AnimeBase, state *queue.State) bool

PushBack is a proxy method to `queue.PushBack`

func (*Relay) PushFront

func (r *Relay) PushFront(anime domain.AnimeBase, state *queue.State) bool

PushFront is a proxy method to `queue.PushFront`

func (*Relay) QueueIsActive

func (r *Relay) QueueIsActive(anime domain.AnimeBase) bool

QueueIsActive returns if the provided anime is in the queue.

func (*Relay) ShouldBroadcast

func (r *Relay) ShouldBroadcast() bool

ShouldBroadcast checks if the queue length is greater than 0 and the queue limit is also greater than 0.

type Update

type Update string
const (
	IRCConnected    Update = "irc_connected"
	IRCDisconnected Update = "irc_disconnected"
	DCCStart        Update = "dcc_start"
	DCCEnd          Update = "dcc_end"
)

Jump to

Keyboard shortcuts

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