hackathon/api/v1/codequest.gunk

35 lines
1014 B
Go

// +gunk proto.Package("hhhapz.codequest.v1")
package codequest
import (
"github.com/gunk/opt/http"
"github.com/gunk/opt/openapiv2"
"github.com/gunk/opt/proto"
"time"
)
// Info is the current information about the competition.
type Info struct {
CurrentUser User `pb:"1" json:"currentUser"`
Active bool `pb:"2" json:"active"`
Points int `pb:"5" json:"points"`
StartTime string `pb:"3" json:"startTime"`
EndTime string `pb:"4" json:"endTime"`
}
// User is a contestant in the competition.
type User struct {
// ID of the user. Received via Google's OAuth2 API.
ID string `pb:"1" json:"id"`
// Name of the user.
Name string `pb:"2" json:"name"`
// Email of the user.
Email string `pb:"3" json:"email"`
// Picture is the URL of the user's profile picture.
Picture string `pb:"4" json:"picture"`
// Admin is true if the user is an administrator.
Admin bool `pb:"6" json:"admin"`
// CreatedAt is the time the user was created.
CreatedAt string `pb:"7" json:"createdAt"`
}