typing

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigCache

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

ConfigCache caches per-user typing tickets obtained from GetConfig.

func NewConfigCache

func NewConfigCache(c *client.Client) *ConfigCache

NewConfigCache creates a new ConfigCache.

func (*ConfigCache) GetTicket

func (cc *ConfigCache) GetTicket(ctx context.Context, userID, contextToken string) (string, error)

GetTicket returns a cached typing ticket for the user, or fetches a new one.

func (*ConfigCache) Invalidate

func (cc *ConfigCache) Invalidate(userID string)

Invalidate removes the cached ticket for a user.

type KeepAlive

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

KeepAlive manages periodic typing indicator sending for a user session.

func NewKeepAlive

func NewKeepAlive(c *client.Client, cache *ConfigCache) *KeepAlive

NewKeepAlive creates a new KeepAlive with the given client and config cache.

func (*KeepAlive) Start

func (k *KeepAlive) Start(ctx context.Context, userID, contextToken string) (stop func())

Start launches a goroutine that sends typing indicators immediately and then every 5 seconds. The returned stop function cancels the goroutine and sends a best-effort cancel typing indicator.

Jump to

Keyboard shortcuts

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