gorm

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBConfig

func NewDBConfig(etcdCli *etcd.Client) (string, *config.DBConfig)

NewDBConfig get config from etcd

Types

type Client

type Client struct {
	*gorm.DB
	Tracer opentracing.Tracer
	Closer io.Closer
}

Client gorm client

func NewClient

func NewClient(config *config.DBConfig) (*Client, error)

NewClient gorm client

func NewClientFromEtcd

func NewClientFromEtcd(etcdCli *etcd.Client, values ...interface{}) (dbCli *Client, err error)

NewClientFromEtcd init gorm from etcd config and watch config to update gorm

func (*Client) ClientWithContext

func (c *Client) ClientWithContext(ctx context.Context) *Client

ClientWithContext ...

Jump to

Keyboard shortcuts

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