Documentation ¶
Index ¶
- func EscapeHtml(origins ...interface{})
- func HTMLEscape(w io.Writer, b []byte)
- func HTMLEscapeString(s string) string
- type MgoCli
- func (m *MgoCli) AddColumn(tableName string, column *storage.Column) error
- func (m *MgoCli) Close()
- func (m *MgoCli) CreateTable(tableName string) error
- func (m *MgoCli) DelByCondition(cName string, condiction interface{}) error
- func (m *MgoCli) DropColumn(tableName, field string) error
- func (m *MgoCli) DropTable(tableName string) error
- func (m *MgoCli) ExecSql(cmd interface{}) error
- func (m *MgoCli) GetCntByCondition(cName string, condition interface{}) (cnt int, err error)
- func (m *MgoCli) GetDBName() string
- func (m *MgoCli) GetIncID(cName string) (incID int64, err error)
- func (m *MgoCli) GetMutilByCondition(cName string, fields []string, condiction interface{}, result interface{}, ...) error
- func (m *MgoCli) GetOneByCondition(cName string, fields []string, condiction interface{}, result interface{}) error
- func (m *MgoCli) GetSession() interface{}
- func (m *MgoCli) GetType() string
- func (m *MgoCli) HasFields(tableName, field string) (bool, error)
- func (m *MgoCli) HasTable(tableName string) (bool, error)
- func (m *MgoCli) Index(tableName string, index *storage.Index) error
- func (m *MgoCli) Insert(cName string, data interface{}) (int, error)
- func (m *MgoCli) InsertMuti(cName string, data ...interface{}) error
- func (m *MgoCli) IsDuplicateErr(err error) bool
- func (m *MgoCli) IsNotFoundErr(err error) bool
- func (m *MgoCli) ModifyColumn(tableName, oldName, newColumn string) error
- func (m *MgoCli) Open() error
- func (m *MgoCli) Ping() error
- func (m *MgoCli) UpdateByCondition(cName string, data, condition interface{}) error
- type MongoConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeHtml ¶
func EscapeHtml(origins ...interface{})
func HTMLEscape ¶
HTMLEscape writes to w the escaped HTML equivalent of the plain text data b.
func HTMLEscapeString ¶
HTMLEscapeString returns the escaped HTML equivalent of the plain text data s.
Types ¶
type MgoCli ¶
type MgoCli struct {
// contains filtered or unexported fields
}
func NewFromConfig ¶
func NewFromConfig(cfg MongoConfig) (*MgoCli, error)
func (*MgoCli) CreateTable ¶
func (*MgoCli) DelByCondition ¶
按条件删除主句
func (*MgoCli) DropColumn ¶
func (*MgoCli) GetCntByCondition ¶
GetCntByCondition returns count number filter by condiction
func (*MgoCli) GetIncID ¶
GetIncID returns next sequence ID for cName collection
db.cc_idgenerator.findAndModify(
{ query:{_id: "sub" }, update: {$inc:{SequenceID:1}}, upsert:true, new:true }).sequence_value
func (*MgoCli) GetMutilByCondition ¶
func (m *MgoCli) GetMutilByCondition(cName string, fields []string, condiction interface{}, result interface{}, sort string, start, limit int) error
GetMutilByCondition get multiple document by condiction
func (*MgoCli) GetOneByCondition ¶
func (m *MgoCli) GetOneByCondition(cName string, fields []string, condiction interface{}, result interface{}) error
GetOneByCondition get one document by condiction
func (*MgoCli) GetSession ¶
func (m *MgoCli) GetSession() interface{}
GetSession returns mongo session
func (*MgoCli) InsertMuti ¶
InsertMuti insert muti documents
func (*MgoCli) IsDuplicateErr ¶
IsDuplicateErr returns whether err is duplicate error
func (*MgoCli) IsNotFoundErr ¶
IsNotFoundErr returns whether err is not found error
func (*MgoCli) ModifyColumn ¶
func (*MgoCli) UpdateByCondition ¶
UpdateByCondition update documents by condiction
type MongoConfig ¶
type MongoConfig struct { Address string User string Password string Database string Port string MaxOpenConns string MaxIdleConns string Mechanism string }
func NewMongoConfig ¶
func NewMongoConfig(src map[string]string) *MongoConfig
Click to show internal directories.
Click to hide internal directories.