github.com/sixexorg/magnetic-ring@v0.0.0-20191119090307-31705a21e419/central/mongokey/mongokey.go (about)

     1  package mongokey
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  const (
     8  	COL_LEAGUE_HEIGHT MongoKey = MongoKey("col_league_height")
     9  )
    10  
    11  type MongoKey string
    12  
    13  func NewVoteDetailPrefixKey(orgid string) MongoKey {
    14  	key := fmt.Sprintf("col_vote_%s",orgid)
    15  	return MongoKey(key)
    16  }
    17  
    18  func NewLeagueTxnsPrefixKey(orgid string) MongoKey {
    19  	key := fmt.Sprintf("col_league_txns_%s",orgid)
    20  	return MongoKey(key)
    21  }
    22  
    23  func NewLeagueMemberPrefixKey(orgid string) MongoKey {
    24  	key := fmt.Sprintf("col_league_members_%s",orgid)
    25  	return MongoKey(key)
    26  }
    27  
    28  func (k MongoKey) Value() string {
    29  	return string(k)
    30  }
    31  
    32  
    33  func NewVoteSatisticsKey(orgid,voteid string) MongoKey {
    34  	key := fmt.Sprintf("col_vtststks_%s_%s",orgid,voteid)
    35  	return MongoKey(key)
    36  }