storage

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ChatID    int64
	MessageID int
	Type      ActionType
	UserID    int
}

type ActionType added in v1.4.0

type ActionType string
const (
	ActionTypeDelete ActionType = "del"
	ActionTypeKick   ActionType = "kick"
)

type InstanceObj

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

func NewStorage added in v1.2.1

func NewStorage(opts Options) (*InstanceObj, error)

func (*InstanceObj) AddNewbieMessages

func (o *InstanceObj) AddNewbieMessages(ctx context.Context, chatID int64, userID int) error

func (*InstanceObj) AddToActionPool

func (o *InstanceObj) AddToActionPool(ctx context.Context, act Action, delay time.Duration) error

func (*InstanceObj) DelKicked

func (o *InstanceObj) DelKicked(ctx context.Context, chatID int64, userID int64) error

func (*InstanceObj) GetFromActionPool

func (o *InstanceObj) GetFromActionPool(ctx context.Context) ([]Action, error)

func (*InstanceObj) GetNewbieMessages

func (o *InstanceObj) GetNewbieMessages(ctx context.Context, chatID int64, userID int) (int, error)

func (*InstanceObj) GetTokenData added in v1.4.0

func (o *InstanceObj) GetTokenData(ctx context.Context, token string) (TokenData, error)

func (*InstanceObj) IsKicked

func (o *InstanceObj) IsKicked(ctx context.Context, chatID int64, userID int) (bool, error)

func (*InstanceObj) NewToken added in v1.4.0

func (o *InstanceObj) NewToken(ctx context.Context, chatID int64) (string, error)

func (*InstanceObj) SetKicked

func (o *InstanceObj) SetKicked(ctx context.Context, chatID int64, userID int, ttl time.Duration) error

func (*InstanceObj) Stop added in v1.2.1

func (o *InstanceObj) Stop() error

type Options added in v1.4.0

type Options struct {
	Log    *zap.SugaredLogger
	Config config.Stor
}

type TokenData added in v1.4.0

type TokenData struct {
	ChatID int64
	TTL    time.Duration
}

Jump to

Keyboard shortcuts

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