github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/setting/redis.go (about) 1 // Copyright 2023 The GitBundle Inc. All rights reserved. 2 // Copyright 2017 The Gitea Authors. All rights reserved. 3 // Use of this source code is governed by a MIT-style 4 // license that can be found in the LICENSE file. 5 6 package setting 7 8 import "github.com/gitbundle/modules/log" 9 10 var ( 11 Redis = struct { 12 Connection string 13 Debug bool 14 Disable bool 15 }{} 16 ) 17 18 func newRedisService() { 19 if err := Cfg.Section("redis").MapTo(&Redis); err != nil { 20 log.Fatal("Failed to map redis settings: %v", err) 21 } 22 23 if Redis.Connection == "" { 24 log.Fatal("Empty Connection for redis setting") 25 } 26 }