ctx

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closer

type Closer func(context.Context) error

Closer - context closer. It saves pending context state on close.

type Current

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

Current is a current context for a chat. It's immutable and changes are not applied antil `Save` is called.

func (*Current) Check

func (c *Current) Check(ctx context.Context, val string) (bool, error)

func (*Current) Load

func (c *Current) Load(cp types.ContextProvider, chatID types.ChatID)

func (*Current) Reset

func (c *Current) Reset(ctx context.Context) error

func (*Current) Save

func (c *Current) Save(ctx context.Context) error

func (*Current) Set

func (c *Current) Set(ctx context.Context, val string) error

type Provider

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

Provider - context provider for pending context state.

func NewProvider

func NewProvider(origin types.ContextProvider) *Provider

func (*Provider) Begin

func (p *Provider) Begin(id types.ChatID) Closer

func (*Provider) UserContext

func (p *Provider) UserContext(id types.ChatID) types.Context

Jump to

Keyboard shortcuts

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