cache

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 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 ClientInterface

type ClientInterface interface {
	GetUser(ctx context.Context, s string) (models.User, bool, error)
	SetUser(ctx context.Context, s string, u models.User) error
	GetGroup(ctx context.Context, s string) (models.Group, bool, error)
	SetGroup(ctx context.Context, s string, g models.Group) error
}

ClientInterface ...

type MemoryCache

type MemoryCache struct {
	CacheClient *gocache.Cache
}

MemoryCache ...

func NewMemoryCache

func NewMemoryCache(expirationInterval time.Duration) (*MemoryCache, error)

NewMemoryCache ...

func (*MemoryCache) GetGroup

func (c *MemoryCache) GetGroup(ctx context.Context, s string) (models.Group, bool, error)

GetGroup ...

func (*MemoryCache) GetUser

func (c *MemoryCache) GetUser(ctx context.Context, s string) (models.User, bool, error)

GetUser ...

func (*MemoryCache) SetGroup

func (c *MemoryCache) SetGroup(ctx context.Context, s string, g models.Group) error

SetGroup ...

func (*MemoryCache) SetUser

func (c *MemoryCache) SetUser(ctx context.Context, s string, u models.User) error

SetUser ...

Jump to

Keyboard shortcuts

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