Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 610 Bytes

README.md

File metadata and controls

41 lines (25 loc) · 610 Bytes

easy

golang sugar library

OS Methods

import "github.com/deoops-net/easy"

  • RootDir() string returns the absolute root directory
fmt.Println(RootDir())

Hash Methods

import "github.com/deoops-net/easy/hash"

  • MD5(string) string
fmt.Println(hash.MD5("foo"))

Database

based on official mongodb driver, for using mongo easily

import db "github.com/deoops-net/easy/db/mongo"

  • db.IniConn(db.MongoConf) nil
  • db.Table(string) *mongo.Collection
conf := db.MongoConf{}
db.IniConn(conf)
db.Table("users").FindOne(context.Background(), bson.M{})