Documentation ¶
Index ¶
- Constants
- Variables
- func CanRetry(maxAllowed int, retryCount int, routingKey *string) bool
- func GetGithubUserData(tokenStruct *GithubToken) *models.GithubUser
- func GetNextChannel(currentChannel string, list string) (*rabbit.WorkerList, string)
- func GetSession(sessionId string) (*models.UserRedis, error)
- func HasEssentials(req *request.Request) bool
- func IsEmail(email string) bool
- func IsMultipart(header string) bool
- func IsValidMGRequest(req *request.Request) bool
- func LogListener(packet amqp.Delivery) (*models.Log, *models.Batch, gocql.UUID, gocql.UUID, int, bool, bool, error)
- func NextChannelToTry(tried map[string]bool) *rabbit.WorkerList
- func ReadMultiPartForm(boundary string, body io.Reader) *multipart.Form
- func SaveSession(sessionId string, data *models.GithubUser) bool
- func UpdateStats(user_id gocql.UUID, key string)
- type GithubToken
Constants ¶
View Source
const MAX_FORM_SIZE = 1024 * 1024 * 1024
Variables ¶
View Source
var EmailRegexp *regexp.Regexp
View Source
var GithubClient = func() *http.Client { transport := &http.Transport{ MaxIdleConns: 200, IdleConnTimeout: 60 * time.Second, DisableCompression: false, } return &http.Client{Transport: transport} }()
View Source
var InitRegex = (func() bool { EmailRegexp = regexp.MustCompile(emailregex) return true }())
Functions ¶
func GetGithubUserData ¶
func GetGithubUserData(tokenStruct *GithubToken) *models.GithubUser
func GetNextChannel ¶
func GetNextChannel(currentChannel string, list string) (*rabbit.WorkerList, string)
Helper for Amq Consumer to get next queue name to be used for retrial
func IsMultipart ¶
func IsValidMGRequest ¶
func LogListener ¶
func LogListener(packet amqp.Delivery) (*models.Log, *models.Batch, gocql.UUID, gocql.UUID, int, bool, bool, error)
A common helper to perform basic checks on a published key on Log queues This helper won't take any decision on the packet, avoiding any arbitary flaws @return
Log: Log Model Batch: Batch Model log_id: UUID of Log Model batch_id: UUID of Batch Model retryCount: int Nack: Negative acknowledge a packet ACK: Positive acknowledge a packet error: error
func NextChannelToTry ¶
func NextChannelToTry(tried map[string]bool) *rabbit.WorkerList
Returns a provider which hasn't been used yet
func SaveSession ¶
func SaveSession(sessionId string, data *models.GithubUser) bool
Types ¶
type GithubToken ¶
type GithubToken struct { Access_Token string `json:access_token` Scope string `json:scope` Token_Type string `json:token_type` }
func GetGithubUserToken ¶
func GetGithubUserToken(code string, state string) *GithubToken
Click to show internal directories.
Click to hide internal directories.