Skip to content

Commit

Permalink
Export the driverName constants (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstmdev committed Dec 10, 2022
1 parent b12f32e commit 58c747a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions buntdb/buntdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
)

const (
driverName = "buntdb"
// DriverName the unique name of the BuntDB driver for register
DriverName = "buntdb"
)

type buntDBCache struct {
Expand Down Expand Up @@ -98,5 +99,5 @@ func parseBuntDBConnection(u *url.URL) (path string, err error) {
}

func init() {
nscache.Register(driverName, newCache)
nscache.Register(DriverName, newCache)
}
5 changes: 3 additions & 2 deletions etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
)

const (
driverName = "etcd"
// DriverName the unique name of the Etcd driver for register
DriverName = "etcd"
)

type etcdCache struct {
Expand Down Expand Up @@ -117,5 +118,5 @@ func parseEtcdConnection(u *url.URL) (c clientv3.Config, err error) {
}

func init() {
nscache.Register(driverName, newCache)
nscache.Register(DriverName, newCache)
}
5 changes: 3 additions & 2 deletions memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
)

const (
driverName = "memory"
// DriverName the unique name of the memory driver for register
DriverName = "memory"
)

type memoryCache struct {
Expand Down Expand Up @@ -78,5 +79,5 @@ func (c *memoryCache) Remove(k string) error {
}

func init() {
nscache.Register(driverName, newCache)
nscache.Register(DriverName, newCache)
}
5 changes: 3 additions & 2 deletions redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (
)

const (
driverName = "redis"
// DriverName the unique name of the Redis driver for register
DriverName = "redis"
)

type redisCache struct {
Expand Down Expand Up @@ -79,5 +80,5 @@ func parseRedisConnection(u *url.URL) (opt *redis.Options, err error) {
}

func init() {
nscache.Register(driverName, newCache)
nscache.Register(DriverName, newCache)
}

0 comments on commit 58c747a

Please sign in to comment.