mongo

package
v0.0.0-...-22ca071 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ThreadChan chan *Thread
	ErrChan    chan string
	FinChan    chan bool
)

Functions

func GetAllColData

func GetAllColData(collectionName string) (*[]interface{}, error)

for debug return all collection data

this method is not userd web app becouse return is interface(map) and map is not defined order

func RegisterThreadOfScore

func RegisterThreadOfScore(holeString string, teamScore *PostTeamScore) error

func RegisterThreadOfTotal

func RegisterThreadOfTotal() error

utils

func SetAllFieldCol

func SetAllFieldCol()

func SetAllPlayerCol

func SetAllPlayerCol()

func SetAllTeamCol

func SetAllTeamCol()

func SetAllThreadCol

func SetAllThreadCol()

func SetAllUserCol

func SetAllUserCol()

func SetFieldCol

func SetFieldCol(hole int)

func SetPlayerCol

func SetPlayerCol(userIds []string)

func SetTeamCol

func SetTeamCol(teamName string)

func SetThreadCol

func SetThreadCol(threadId string)

func SetUserCol

func SetUserCol(userIds []string)

func UpdateMongoData

func UpdateMongoData(collection string, findQuery bson.M, updateQuery bson.M) error

func UpsertNewTimeLine

func UpsertNewTimeLine(thread *Thread) error

Types

type EntireScore

type EntireScore struct {
	Rows [][]string `json:"rows"`
}

func GetEntireScorePageData

func GetEntireScorePageData() (*EntireScore, error)

type FieldCol

type FieldCol struct {
	Id             bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Hole           int           `json:"hole"`
	DrivingContest bool          `json:"drivingContest"`
	Ignore         bool          `json:"ignore"`
	Image          string        `json:"image"`
	NearPin        bool          `json:"nearPin"`
	Par            int           `json:"par"`
	Yard           int           `json:"yard"`
	Date           string        `json:"date"`
}

type FinalRanking

type FinalRanking struct {
	UserId    string
	ScoreDiff int
	Gross     int
}

type Hole

type Hole struct {
	Hole  int   `json:"hole"`
	Par   int   `json:"par"`
	Yard  int   `json:"yard"`
	Score []int `json:"score"`
}

type Index

type Index struct {
	Team   []string `json:"team"`
	Length int      `json:"length"`
}

func GetIndexPageData

func GetIndexPageData() (*Index, error)

type LeadersBoard

type LeadersBoard struct {
	Ranking []UserScore `json:"ranking"`
}

func GetLeadersBoardPageData

func GetLeadersBoardPageData() (*LeadersBoard, error)

type LoginStatus

type LoginStatus struct {
	Status   string `json:"status"`
	UserId   string `json:"userId"`
	UserName string `json:"userName"`
	Team     string `json:"team"`
	Admin    bool   `json:"admin"`
}

reponse status

func PostLoginPageData

func PostLoginPageData(loginInfo *PostLogin) (*LoginStatus, error)

type PlayerCol

type PlayerCol struct {
	Id               bson.ObjectId `json:"id" bson:"_id,omitempty"`
	UserId           string        `json:"userId"`
	Apply            int           `json:"apply"`
	PositivePhotoUrl string        `json:"positivePhotoUrl"`
	NegativePhotoUrl string        `json:"negativePhotoUrl"`
	//	Editable bool          `json:"editable"`
	Score []bson.M `json:"score"`
	Date  string   `json:"date"`
	Admin bool     `json:"admin"`
}

type PostApplyScore

type PostApplyScore struct {
	UserIds []string `json:"userIds"`
	Apply   []int    `json:"apply"`
}

type PostDefinedTeam

type PostDefinedTeam struct {
	Team string `json:"team"`
}

type PostLogin

type PostLogin struct {
	UserId string `json:"userId"`
	Date   string `json:"date"`
}

type PostTeamScore

type PostTeamScore struct {
	UserIds []string `json:"userIds"`
	Total   []int    `json:"total"`
	Putt    []int    `json:"putt"`
	Excnt   int      `json:"excnt"`
}

type Reaction

type Reaction struct {
	UserName    string `json:"userName"`
	UserId      string `json:"userId"`
	ContentType int    `json:"contentType"`
	Content     string `json:"content"`
	DateTime    string `json:"dateTime"`
}

type RequestTakePictureStatus

type RequestTakePictureStatus struct {
	Status      string   `json:"status"`
	UserId      string   `json:"userId"`
	TeamUserIds []string `json:"teamUserIds"`
	Name        string   `json:"name"`
	Positive    bool     `json:"positive"`
	ThreadMsg   string   `json:"threadMsg"`
	ThreadId    string   `json:"threadId"`
	PhotoUrl    string   `json:"photoUrl"`
}

func PostScoreEntrySheetPageData

func PostScoreEntrySheetPageData(teamName string, holeString string, teamScore *PostTeamScore) (*RequestTakePictureStatus, error)

func RequestTakePicture

func RequestTakePicture(userIds []string) (*RequestTakePictureStatus, error)

type ScoreEntrySheet

type ScoreEntrySheet struct {
	Team    string   `json:"team"`
	Hole    int      `json:"hole"`
	Member  []string `json:"member"`
	UserIds []string `json:"userIds"`
	Par     int      `json:"par"`
	Yard    int      `json:"yard"`
	Total   []int    `json:"total"`
	Putt    []int    `json:"putt"`
	Excnt   int      `json:"excnt"`
}

func GetScoreEntrySheetPageData

func GetScoreEntrySheetPageData(teamName string, holeString string) (*ScoreEntrySheet, error)

type ScoreViewSheet

type ScoreViewSheet struct {
	Team    string   `json:"team"`
	Member  []string `json:"member"`
	UserIds []string `json:"userIds"`
	Apply   []int    `json:"apply"`
	Hole    []Hole   `json:"hole"`
	OutSum  Sum      `json:"outSum"`
	InSum   Sum      `json:"inSum"`
	Sum     Sum      `json:"sum"`
	Defined bool     `json:"defined"`
}

func GetScoreViewSheetPageData

func GetScoreViewSheetPageData(teamName string) (*ScoreViewSheet, error)

type Status

type Status struct {
	Status string `json:"status"`
}

func PostApplyScoreData

func PostApplyScoreData(teamName string, ApplyScore *PostApplyScore) (*Status, error)

func PostScoreViewSheetPageData

func PostScoreViewSheetPageData(teamName string, definedTeam *PostDefinedTeam) (*Status, error)

func RegisterFieldColData

func RegisterFieldColData(date string, fieldCols []FieldCol) (*Status, error)

func RegisterTeamColData

func RegisterTeamColData(date string, teamCols []TeamCol) (*Status, error)

func RegisterUserColData

func RegisterUserColData(userCols []UserCol) (*Status, error)

type Sum

type Sum struct {
	Par   int   `json:"par"`
	Score []int `json:"score"`
	Putt  []int `json:"putt"`
}

type TeamCol

type TeamCol struct {
	Id      bson.ObjectId `json:"id" bson:"_id,omitempty"`
	UserIds []string      `json:"userIds"`
	Name    string        `json:"name"`
	Defined bool          `json:"defined"`
	Date    string        `json:"date"`
}

type Thread

type Thread struct {
	ThreadId  string     `json:"threadId"`
	UserId    string     `json:"userId"`
	UserName  string     `json:"userName"`
	Msg       string     `json:"msg"`
	ImgUrl    string     `json:"imgUrl"`
	ColorCode string     `json:"colorCode"`
	Positive  bool       `json:"positive"`
	Reactions []Reaction `json:"reactions"`
	CreatedAt string     `json:"createdAt"`
}

func UpdateExistingTimeLine

func UpdateExistingTimeLine(thread *Thread) (*Thread, error)

type ThreadCol

type ThreadCol struct {
	Id        bson.ObjectId `json:"id" bson:"_id,omitempty"`
	UserId    string        `json:"userId"`
	UserName  string        `json:"userName"`
	ThreadId  string        `json:"threadId"`
	Msg       string        `json:"msg"`
	ImgUrl    string        `json:"imgUrl"`
	ColorCode string        `json:"colorCode"`
	Positive  bool          `json:"positive"`
	Reactions []bson.M      `json:"reactions"`
	CreatedAt string        `json:"createdAt"`
	Date      string        `json:"Date"`
}

type ThreadDate

type ThreadDate struct {
	ThreadId  string
	CreatedAt string
}

type TimeLine

type TimeLine struct {
	Threads []Thread `json:"threads"`
}

func GetTimeLinePageData

func GetTimeLinePageData() (*TimeLine, error)

type TimeLineWs

type TimeLineWs struct {
	Msg string `json:"msg"`
}

websocket struct

type UserCol

type UserCol struct {
	Id            bson.ObjectId `json:"id" bson:"_id,omitempty"`
	UserId        string        `json:"userId"`
	Name          string        `json:"name"`
	CreatedAt     string        `json:"createdAt"`
	ImgUrl        string        `json:"imgUrl"`
	Participation []bson.M      `json:"participation"`
}

Structs for Collections

type UserScore

type UserScore struct {
	Score int    `json:"score"`
	Name  string `json:"name"`
	Hole  int    `json:"hole"`
	Total int    `json:"total"`
}

Structs for Page

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL