cache

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInCache

func NewInCache(db account.Store) account.Store

Types

type Cache

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

func (*Cache) BatchSetNextAirdropTimestamp

func (c *Cache) BatchSetNextAirdropTimestamp(ctx context.Context, ts time.Time, userIDs ...*commonpb.UserId) error

func (*Cache) Bind

func (c *Cache) Bind(ctx context.Context, userID *commonpb.UserId, pubKey *commonpb.PublicKey) (*commonpb.UserId, error)

func (*Cache) ExtendAirdropEligibility

func (c *Cache) ExtendAirdropEligibility(ctx context.Context, userID *commonpb.UserId, until time.Time) error

func (*Cache) GetAirdropEligibilityTimestamp

func (c *Cache) GetAirdropEligibilityTimestamp(ctx context.Context, userID *commonpb.UserId) (time.Time, error)

func (*Cache) GetNextAirdropTimestamp

func (c *Cache) GetNextAirdropTimestamp(ctx context.Context, userID *commonpb.UserId) (time.Time, error)

func (*Cache) GetPubKeys

func (c *Cache) GetPubKeys(ctx context.Context, userID *commonpb.UserId) ([]*commonpb.PublicKey, error)

func (*Cache) GetUserId

func (c *Cache) GetUserId(ctx context.Context, pubKey *commonpb.PublicKey) (*commonpb.UserId, error)

func (*Cache) GetUsersToAirdrop

func (c *Cache) GetUsersToAirdrop(ctx context.Context, at time.Time) ([]*commonpb.UserId, error)

func (*Cache) IsAuthorized

func (c *Cache) IsAuthorized(ctx context.Context, userID *commonpb.UserId, pubKey *commonpb.PublicKey) (bool, error)

func (*Cache) IsRegistered

func (c *Cache) IsRegistered(ctx context.Context, userID *commonpb.UserId) (bool, error)

func (*Cache) IsStaff

func (c *Cache) IsStaff(ctx context.Context, userID *commonpb.UserId) (bool, error)

func (*Cache) RemoveKey

func (c *Cache) RemoveKey(ctx context.Context, userID *commonpb.UserId, pubKey *commonpb.PublicKey) error

func (*Cache) SetRegistrationFlag

func (c *Cache) SetRegistrationFlag(ctx context.Context, userID *commonpb.UserId, isRegistered bool) error

Jump to

Keyboard shortcuts

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