mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化目录名称
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package mangomodule
|
||||
package mongomodule
|
||||
|
||||
import (
|
||||
"github.com/duanhf2012/origin/log"
|
||||
@@ -22,18 +22,18 @@ type DialContext struct {
|
||||
takeSessionIdx uint32
|
||||
}
|
||||
|
||||
type MangoModule struct {
|
||||
type MongoModule struct {
|
||||
dailContext *DialContext
|
||||
}
|
||||
|
||||
func (slf *MangoModule) Init(url string,sessionNum uint32,dialTimeout time.Duration, timeout time.Duration) error {
|
||||
func (slf *MongoModule) Init(url string,sessionNum uint32,dialTimeout time.Duration, timeout time.Duration) error {
|
||||
var err error
|
||||
slf.dailContext, err = dialWithTimeout(url, sessionNum, dialTimeout*time.Second, timeout*time.Minute)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (slf *MangoModule) Take() *Session{
|
||||
func (slf *MongoModule) Take() *Session{
|
||||
return slf.dailContext.Take()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package mangomodule
|
||||
package mongomodule
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -17,7 +17,7 @@ type Student struct {
|
||||
}
|
||||
|
||||
func Test_Example(t *testing.T) {
|
||||
module:=MangoModule{}
|
||||
module:=MongoModule{}
|
||||
module.Init("127.0.0.1",100, 5*time.Second,5*time.Second)
|
||||
|
||||
// take session
|
||||
Reference in New Issue
Block a user