Skip to content

Jetcache-go-plugin is a place for community maintained plugins.

License

Notifications You must be signed in to change notification settings

mgtv-tech/jetcache-go-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codeCov Go Repport Card License

Overview

jetcache-go-pluginjetcache-go 维护的插件项目。

Getting started

Remote Adapter

import (
    "github.com/mgtv-tech/jetcache-go"
    "github.com/mgtv-tech/jetcache-go-plugin/remote"
)

mycache := cache.New(cache.WithName("any"),
    cache.WithRemote(remote.NewGoRedisV8Adapter(ring)),
    cache.WithLocal(local.NewFreeCache(256*local.MB, time.Minute)),
    // ...
)

Local

TODO

Stats

import (
    "github.com/mgtv-tech/jetcache-go"
    "github.com/mgtv-tech/jetcache-go-plugin/remote"
    pstats "github.com/mgtv-tech/jetcache-go-plugin/stats"
    "github.com/mgtv-tech/jetcache-go/stats"
)

cacheName := "demo"
jetcache := cache.New(cache.WithRemote(remote.NewGoRedisV8Adapter(ring)),
    cache.WithStatsHandler(
        stats.NewHandles(false,
            stats.NewStatsLogger(cacheName), 
            pstats.NewPrometheus(cacheName))))

同时集成日志统计和Prometheus统计。

Encoding

TODO