storage

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Manager

type Manager struct {
	sync.Map
}

func (*Manager) Get

func (m *Manager) Get(component string) storage.Storage

func (*Manager) New

func (m *Manager) New(component string)

type Storage

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

func (*Storage) GetCommon

func (s *Storage) GetCommon(schema configure.Schema) interface{}

func (*Storage) GetDB

func (s *Storage) GetDB(readOnly ...bool) *gorm.DB

func (*Storage) GetRedis

func (s *Storage) GetRedis(key interface{}) redis.Cmdable

func (*Storage) GetRedisz

func (s *Storage) GetRedisz() []redis.Cmdable

func (*Storage) InitCommon

func (s *Storage) InitCommon(config configure.Address) error

func (*Storage) InitDB

func (s *Storage) InitDB(master configure.Address, slaves []configure.Address, opts ...storage.SQLOption) error

func (*Storage) InitRedis

func (s *Storage) InitRedis(configs []configure.Address, opts ...storage.RedisOption) error

Jump to

Keyboard shortcuts

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