data

package
v0.0.0-...-f10161e Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	WelcomeMessage *tb.Message
	RightAnswer    int
}

type MemoryStorage

type MemoryStorage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MemoryStorage storing in memory for simplicity

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) Add

func (s *MemoryStorage) Add(chat *tb.Chat, user *tb.User, i Info)

func (*MemoryStorage) Exist

func (s *MemoryStorage) Exist(chat *tb.Chat, user *tb.User) (Info, bool)

func (*MemoryStorage) Remove

func (s *MemoryStorage) Remove(chat *tb.Chat, user *tb.User)

type Storage

type Storage interface {
	Add(chat *tb.Chat, user *tb.User, i Info)
	Remove(chat *tb.Chat, user *tb.User)
	Exist(chat *tb.Chat, user *tb.User) (Info, bool)
}

Jump to

Keyboard shortcuts

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