dao

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

func New

func New(c config.Config) *Dao

func (*Dao) CheckApiIdAndHash

func (d *Dao) CheckApiIdAndHash(apiId int32, apiHash string) error

func (*Dao) CheckCanDoAction

func (d *Dao) CheckCanDoAction(ctx context.Context,
	authKeyId int64,
	phoneNumber string,
	actionType int) error

func (*Dao) CreatePhoneCode

func (d *Dao) CreatePhoneCode(ctx context.Context,
	authKeyId int64,
	sessionId int64,
	phoneNumber string,
	phoneNumberRegistered bool,
	sendCodeType, nextCodeType, state int) (codeData *model.PhoneCodeTransaction, err error)

CreatePhoneCode for sendCode

func (*Dao) DeleteCachePhoneCode

func (d *Dao) DeleteCachePhoneCode(ctx context.Context, authKeyId int64, phoneNumber string) (err error)

func (*Dao) DeletePhoneCode

func (d *Dao) DeletePhoneCode(ctx context.Context, authKeyId int64, phoneNumber, phoneCodeHash string) error

func (*Dao) GetCachePhoneCode

func (d *Dao) GetCachePhoneCode(ctx context.Context, authKeyId int64, phoneNumber string) (*model.PhoneCodeTransaction, error)

func (*Dao) GetCountryAndRegionByIp

func (d *Dao) GetCountryAndRegionByIp(ip string) (string, string)

func (*Dao) GetPhoneCode

func (d *Dao) GetPhoneCode(ctx context.Context,
	authKeyId int64,
	phoneNumber, phoneCodeHash string) (codeData *model.PhoneCodeTransaction, err error)

func (*Dao) PutCachePhoneCode

func (d *Dao) PutCachePhoneCode(ctx context.Context, authKeyId int64, phoneNumber string, codeData *model.PhoneCodeTransaction) (err error)

func (*Dao) UpdatePhoneCodeData

func (d *Dao) UpdatePhoneCodeData(ctx context.Context,
	authKeyId int64,
	phoneNumber, phoneCodeHash string,
	codeData *model.PhoneCodeTransaction) error

Jump to

Keyboard shortcuts

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