bg

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 2 Imported by: 10

Documentation

Overview

Package bg implements wrapper for running client in background.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Run(ctx context.Context, f func(ctx context.Context) error) error
}

Client abstracts telegram client.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option for Connect.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets base context for client.

type StopFunc

type StopFunc func() error

StopFunc closes Client and waits until Run returns.

func Connect

func Connect(client Client, options ...Option) (StopFunc, error)

Connect blocks until client is connected, calling Run internally in background.

Jump to

Keyboard shortcuts

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