cacheInterceptor

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxLogger

func CtxLogger(ctx context.Context) *logrus.Entry

func GetLogger

func GetLogger() *logrus.Logger

Types

type CacheInterceptor

type CacheInterceptor struct {
	MethodToCache map[string]*Option
	// contains filtered or unexported fields
}

func New

func New(redisClient redis.UniversalClient, prefix string, methodToCache map[string]*Option, opt *Option) *CacheInterceptor

func (*CacheInterceptor) AddMethodToCache

func (c *CacheInterceptor) AddMethodToCache(method string, opt *Option)

func (*CacheInterceptor) Interceptor

func (c *CacheInterceptor) Interceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

type Option

type Option struct {
	TTL                     int64
	MetadataDistinguishable bool
}

Jump to

Keyboard shortcuts

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