Documentation
¶
Index ¶
- Variables
- func Aes128Decrypt(str string, opts ...Option) (s string)
- func Aes128Encrypt(str string, opts ...Option) (s string)
- func BadgerBatch(dats []map[string]string, opts ...Option) error
- func BadgerExists(key string, opts ...Option) bool
- func BadgerGet(key string, opts ...Option) (any, error)
- func BadgerRemove(key string, opts ...Option) error
- func BadgerScan(prefix string, opts ...Option) ([]map[string]any, uint64, error)
- func BadgerScanKeyOnly(prefix string, opts ...Option) ([]string, uint64, error)
- func BadgerSet(key string, data any, opts ...Option) error
- func BleveDocCount(opt ...Option) (uint64, error)
- func BleveDocument(id string, opts ...Option) (map[string]any, error)
- func BleveIndex(id string, data map[string]any, opts ...Option) error
- func BleveRemove(id string, opts ...Option) error
- func BleveSearch(s string, opts ...Option) ([]map[string]any, int64, error)
- func CloseAllDbs()
- func GetSnowflakeOrderNo() int64
- func InitBadger(opts ...Option)
- func InitBleve(opts ...Option) error
- func InitCasbin(csvfile string, sub any)
- func InitDirectory(npath ...string) (string, bool)
- func InitGormDB(opts ...Option)
- func InitPsqlDB(opts ...Option)
- func InitRedis(opts ...Option)
- func JwtCreate(data map[string]any, opts ...Option) (string, error)
- func JwtValidate(tokenString string, opts ...Option) (any, error)
- func MD5(str string, is16 bool) string
- func RsaDecrypt(ciphertext []byte, opts ...Option) ([]byte, error)
- func RsaEncrypt(origData []byte, opts ...Option) ([]byte, error)
- func SHA1(str string) string
- func SHA256(data string) string
- type Option
- func WithAesKeyAndIv(key, iv string) Option
- func WithCacheFolder(folderName string) Option
- func WithDSN(dsn string) Option
- func WithDbType(dbtype string) Option
- func WithField(field string) Option
- func WithIdleConns(idleConns int) Option
- func WithIndex(index int) Option
- func WithJwtSecureKey(jwtSecureKey string) Option
- func WithKeyword(keyword string) Option
- func WithMaxLifeTime(maxLifeTime int) Option
- func WithPage(page int) Option
- func WithPageSize(pagesize int) Option
- func WithPubicPrivateKey(publicKey, privateKey string) Option
- func WithReturnField(field string) Option
- func WithSortField(field string) Option
- func WithTotal(total int) Option
- func WithTtl(ttl int) Option
- func WithmaxConns(maxConns int) Option
- type SseHander
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Db *gorm.DB Rdb *redis.Client Casbin *casbin.Enforcer Bleve []bleve.Index CacheDb []*badger.DB )
View Source
var SseClients = make(map[string]chan string, 0)
<script>
if ('EventSource' in window) {
let token = document.querySelector("#token").value
var eventsoure = new EventSource(`http://127.0.0.1:8080/sse/${token}`,{ withCredentials: true })
eventsoure.onmessage = function(event){
console.log("message=", event.data)
}
}else{
document.write("No support eventsource")
}
</script>
Functions ¶
func BadgerScan ¶
从缓存中查询对应的key和值
func BadgerScanKeyOnly ¶
从缓存中只查询对应的key
func BleveDocument ¶
根据id得到搜索引擎中文档内容
func BleveSearch ¶
搜索引擎搜索指定关键字
Types ¶
type Option ¶
type Option func(options *options)
func WithAesKeyAndIv ¶
func WithCacheFolder ¶
func WithDbType ¶
func WithIdleConns ¶
func WithJwtSecureKey ¶
func WithKeyword ¶
func WithMaxLifeTime ¶
func WithPageSize ¶ added in v0.0.3
func WithPubicPrivateKey ¶
func WithReturnField ¶
func WithSortField ¶ added in v0.0.3
func WithmaxConns ¶
type SseHander ¶
type SseHander struct {
}
func (*SseHander) BoardcaseMap ¶
广播hashmap
func (*SseHander) BoardcaseText ¶
广播文本
Click to show internal directories.
Click to hide internal directories.