Documentation ¶
Index ¶
Constants ¶
View Source
const ( Port = ":8080" TokenIssuer = "https://.com" Issuer2 = "accounts.google.com" CAccessToken = "access-token" CAccessClaims = "access-claims" CRefreshToken = "refresh-token" CRefreshClaims = "refresh-claims" )
Variables ¶
View Source
var ( Env = os.Getenv("ENV") TokenSignatureKey string = "secret overwritten by init.go" ClientKey string = os.Getenv("ANDROID_KEY") SwaggerUrl string = "https://www.google.com/" //Database DB *sql.DB = nil DB_URL string = os.Getenv("DB_URL") )
ENV and SECRETS
Functions ¶
Types ¶
type Claims ¶
type Claims struct { ID int `json:"id"` UserName string `json:"user_name"` DisplayName string `json:"display_name"` Email string `json:"email"` jwt.StandardClaims }
Define a struct that will be encoded to a token
type Credentials ¶
type Credentials struct { Id int `json:"id"` UserName string `json:"user_name" binding:"required"` DisplayName string `json:"display_name"` Email string `json:"email" binding:"required"` Password string `json:"password"` }
Credentials represents the data needed to generate a token.
type Error ¶
type Error struct { Time string `json:"time_RFC3339"` Path string `json:"path"` Status int `json:"status"` Error string `json:"error"` }
Error represents the data returned by an aborted HTTP request.
func DetailError ¶
DetailError returns an Error struct with the given status and message.
func IntIdtoUint ¶
type HandlerResponse ¶
type HandlerResponse struct { Code int `json:"code"` Data interface{} `json:"data"` }
Click to show internal directories.
Click to hide internal directories.