cache

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginType = "cache"
)

Variables

View Source
var File_plugin_executable_cache_dump_proto protoreflect.FileDescriptor

Functions

func Init

func Init(bp *coremain.BP, args any) (any, error)

Types

type Args

type Args struct {
	Size         int    `yaml:"size"`
	LazyCacheTTL int    `yaml:"lazy_cache_ttl"`
	DumpFile     string `yaml:"dump_file"`
	DumpInterval int    `yaml:"dump_interval"`
}

type Cache

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

func NewCache

func NewCache(args *Args, opts Opts) *Cache

func (*Cache) Api

func (c *Cache) Api() *chi.Mux

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Exec

func (c *Cache) Exec(ctx context.Context, qCtx *query_context.Context, next sequence.ChainWalker) error

func (*Cache) RegMetricsTo

func (c *Cache) RegMetricsTo(r prometheus.Registerer) error

type CacheDumpBlock

type CacheDumpBlock struct {
	Entries []*CachedEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

func (*CacheDumpBlock) Descriptor deprecated

func (*CacheDumpBlock) Descriptor() ([]byte, []int)

Deprecated: Use CacheDumpBlock.ProtoReflect.Descriptor instead.

func (*CacheDumpBlock) GetEntries

func (x *CacheDumpBlock) GetEntries() []*CachedEntry

func (*CacheDumpBlock) ProtoMessage

func (*CacheDumpBlock) ProtoMessage()

func (*CacheDumpBlock) ProtoReflect

func (x *CacheDumpBlock) ProtoReflect() protoreflect.Message

func (*CacheDumpBlock) Reset

func (x *CacheDumpBlock) Reset()

func (*CacheDumpBlock) String

func (x *CacheDumpBlock) String() string

type CachedEntry

type CachedEntry struct {
	Key                 []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Msg                 []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	CacheExpirationTime int64  `protobuf:"varint,3,opt,name=cache_expiration_time,json=cacheExpirationTime,proto3" json:"cache_expiration_time,omitempty"`
	MsgExpirationTime   int64  `protobuf:"varint,4,opt,name=msg_expiration_time,json=msgExpirationTime,proto3" json:"msg_expiration_time,omitempty"`
	MsgStoredTime       int64  `protobuf:"varint,5,opt,name=msg_stored_time,json=msgStoredTime,proto3" json:"msg_stored_time,omitempty"`
	// contains filtered or unexported fields
}

func (*CachedEntry) Descriptor deprecated

func (*CachedEntry) Descriptor() ([]byte, []int)

Deprecated: Use CachedEntry.ProtoReflect.Descriptor instead.

func (*CachedEntry) GetCacheExpirationTime

func (x *CachedEntry) GetCacheExpirationTime() int64

func (*CachedEntry) GetKey

func (x *CachedEntry) GetKey() []byte

func (*CachedEntry) GetMsg

func (x *CachedEntry) GetMsg() []byte

func (*CachedEntry) GetMsgExpirationTime

func (x *CachedEntry) GetMsgExpirationTime() int64

func (*CachedEntry) GetMsgStoredTime

func (x *CachedEntry) GetMsgStoredTime() int64

func (*CachedEntry) ProtoMessage

func (*CachedEntry) ProtoMessage()

func (*CachedEntry) ProtoReflect

func (x *CachedEntry) ProtoReflect() protoreflect.Message

func (*CachedEntry) Reset

func (x *CachedEntry) Reset()

func (*CachedEntry) String

func (x *CachedEntry) String() string

type Opts

type Opts struct {
	Logger     *zap.Logger
	MetricsTag string
}

Jump to

Keyboard shortcuts

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