telegram

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeMarkdownV2 added in v0.6.0

func EscapeMarkdownV2(v any) string

func Ref added in v0.5.17

func Ref(v any, url string) string

func Spoiler added in v0.5.31

func Spoiler(v any) string

func UserIdRef added in v0.6.0

func UserIdRef(v any, id int64) string

func UserRef added in v0.6.0

func UserRef(v any, user string) string

Types

type AlertBot

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

func NewAlertBot

func NewAlertBot(token string, chatId string, version string) *AlertBot

func (*AlertBot) Close added in v0.5.30

func (o *AlertBot) Close()

func (*AlertBot) Closing added in v0.5.30

func (o *AlertBot) Closing()

func (*AlertBot) QueueSize added in v0.5.30

func (o *AlertBot) QueueSize() int

func (*AlertBot) Send

func (o *AlertBot) Send(message string)

func (*AlertBot) SendLog

func (o *AlertBot) SendLog(m ulog.Message)

func (*AlertBot) Sendf added in v0.2.79

func (o *AlertBot) Sendf(f string, v ...any)

func (*AlertBot) SetLogMessageLimit added in v0.6.6

func (o *AlertBot) SetLogMessageLimit(limit int)

func (*AlertBot) SetQueue added in v0.5.30

func (o *AlertBot) SetQueue(queue QueueIf[string])

func (*AlertBot) Shutdown

func (o *AlertBot) Shutdown(ts time.Duration)

func (*AlertBot) Startup

func (o *AlertBot) Startup()

type Limiter

type Limiter[T any] struct {
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter[T any](send func(T)) *Limiter[T]

func (*Limiter[T]) Close

func (o *Limiter[T]) Close()

func (*Limiter[T]) Push

func (o *Limiter[T]) Push(m T) bool

func (*Limiter[T]) Queue added in v0.5.30

func (o *Limiter[T]) Queue() QueueIf[T]

func (*Limiter[T]) SetInterval added in v0.5.30

func (o *Limiter[T]) SetInterval(interval time.Duration)

func (*Limiter[T]) SetQueue added in v0.5.30

func (o *Limiter[T]) SetQueue(queue QueueIf[T])

type LimiterIf added in v0.5.30

type LimiterIf[T any] interface {
	SetInterval(time.Duration)
	SetQueue(QueueIf[T])
	Queue() QueueIf[T]
	Close()
	Push(T) bool
}

type Queue added in v0.5.30

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewQueue added in v0.5.30

func NewQueue[T any]() *Queue[T]

func (*Queue[T]) Capacity added in v0.5.30

func (o *Queue[T]) Capacity() int

func (*Queue[T]) Pop added in v0.5.30

func (o *Queue[T]) Pop() (v T, ok bool)

func (*Queue[T]) Push added in v0.5.30

func (o *Queue[T]) Push(v T) bool

func (*Queue[T]) Reset added in v0.5.30

func (o *Queue[T]) Reset()

func (*Queue[T]) SetCapacity added in v0.5.30

func (o *Queue[T]) SetCapacity(capacity int)

func (*Queue[T]) Size added in v0.5.30

func (o *Queue[T]) Size() int

type QueueIf added in v0.5.30

type QueueIf[T any] interface {
	SetCapacity(int)
	Capacity() int
	Size() int
	Reset()
	Push(T) bool
	Pop() (T, bool)
}

Jump to

Keyboard shortcuts

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