@@ -19,8 +19,8 @@ const (
1919 emptyEnableTime = "STR_TO_DATE('1980-01-01 00:00:01', '%Y-%m-%d %H:%i:%s')"
2020)
2121
22- // postgresqlStore 实现了Store接口
23- type postgresqlStore struct {
22+ // PostgresqlStore 实现了Store接口
23+ type PostgresqlStore struct {
2424 * namespaceStore
2525 // client info stores
2626 * clientStore
@@ -66,12 +66,12 @@ type postgresqlStore struct {
6666}
6767
6868// Name 实现Name函数
69- func (p * postgresqlStore ) Name () string {
69+ func (p * PostgresqlStore ) Name () string {
7070 return STORENAME
7171}
7272
7373// Initialize 初始化函数
74- func (p * postgresqlStore ) Initialize (conf * store.Config ) error {
74+ func (p * PostgresqlStore ) Initialize (conf * store.Config ) error {
7575 if p .start {
7676 return nil
7777 }
@@ -115,7 +115,7 @@ func (p *postgresqlStore) Initialize(conf *store.Config) error {
115115}
116116
117117// Destroy 退出函数
118- func (p * postgresqlStore ) Destroy () error {
118+ func (p * PostgresqlStore ) Destroy () error {
119119 p .start = false
120120
121121 if p .master != nil {
@@ -140,7 +140,7 @@ func (p *postgresqlStore) Destroy() error {
140140}
141141
142142// CreateTransaction 创建一个事务
143- func (p * postgresqlStore ) CreateTransaction () (store.Transaction , error ) {
143+ func (p * PostgresqlStore ) CreateTransaction () (store.Transaction , error ) {
144144 // 每次创建事务前,还是需要ping一下
145145 _ = p .masterTx .Ping ()
146146
@@ -156,7 +156,7 @@ func (p *postgresqlStore) CreateTransaction() (store.Transaction, error) {
156156 return nt , nil
157157}
158158
159- func (p * postgresqlStore ) StartTx () (store.Tx , error ) {
159+ func (p * PostgresqlStore ) StartTx () (store.Tx , error ) {
160160 tx , err := p .masterTx .Begin ()
161161 if err != nil {
162162 return nil , err
@@ -235,7 +235,7 @@ func parseStoreConfig(opts interface{}) (*dbConfig, error) {
235235}
236236
237237// newStore 初始化子类
238- func (p * postgresqlStore ) newStore () {
238+ func (p * PostgresqlStore ) newStore () {
239239 p .namespaceStore = & namespaceStore {master : p .master , slave : p .slave }
240240
241241 p .serviceStore = & serviceStore {master : p .master , slave : p .slave }
@@ -280,7 +280,7 @@ func (p *postgresqlStore) newStore() {
280280}
281281
282282func init () {
283- s := & postgresqlStore {}
283+ s := & PostgresqlStore {}
284284 err := store .RegisterStore (s )
285285 if err != nil {
286286 log .Errorf ("[Store][database] RegisterStore err: %+v" , err )
0 commit comments