Documentation ¶
Overview ¶
Package session manage db connection
Index ¶
Constants ¶
View Source
const ( DBName = "kie" CollectionLabel = "label" CollectionKV = "kv" CollectionKVRevision = "kv_revision" CollectionPollingDetail = "polling_detail" CollectionCounter = "counter" CollectionView = "view" DefaultTimeout = 5 * time.Second DefaultValueType = "text" )
const for db name and collection name
View Source
const ( MsgDBExists = "already exists" MsgDuplicate = "duplicate key error collection" )
Variables ¶
View Source
var ( ErrMissingDomain = errors.New("domain info missing, illegal access") ErrMissingProject = errors.New("project info missing, illegal access") ErrLabelNotExists = errors.New("labels does not exits") ErrTooMany = errors.New("key with labels should be only one") ErrKeyMustNotEmpty = errors.New("must supply key if you want to get exact one result") ErrIDIsNil = errors.New("id is empty") ErrKeyIsNil = errors.New("key must not be empty") ErrRootCAMissing = errors.New("rootCAFile is empty in config file") ErrKVAlreadyExists = errors.New("kv already exists") ErrViewCreation = errors.New("can not create view") ErrViewUpdate = errors.New("can not update view") ErrViewDelete = errors.New("can not delete view") ErrViewNotExist = errors.New("view not exists") ErrViewFinding = errors.New("view search error") ErrGetPipeline = errors.New("can not get criteria") )
db errors
View Source
var Timeout time.Duration
Timeout db operation time out
Functions ¶
func CreateView ¶
CreateView run mongo db command to create view
func OpenSession ¶
func OpenSession() *mgo.Session
Types ¶
type CollectionInfo ¶
type CollectionInfo struct {
Options Options `json:"options"`
}
CollectionInfo is struct
func GetColInfo ¶
func GetColInfo(ctx context.Context, name string) (*CollectionInfo, error)
GetColInfo get collection info
Click to show internal directories.
Click to hide internal directories.