tickets

package
v0.0.0-...-46141d0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CAPTCHADisabled = false

CAPTCHADisabled disables captcha requirements if true

View Source
var DatabaseURL string
View Source
var HostName string
View Source
var Mailer *mailerHelper
View Source
var Repo *repo
View Source
var VerificationURL = "https://www.google.com/recaptcha/api/siteverify"

defaultVerificationURL is The default URL that's used to verify the user's response to the challenge. @see https://developers.google.com/recaptcha/docs/verify#api-request

Functions

func ConfirmationEmail

func ConfirmationEmail(g Guest, slot time.Time) hermes.Email

func ExpirationEmail

func ExpirationEmail(g Guest, slot time.Time) hermes.Email

Types

type Guest

type Guest struct {
	ID        string
	Email     string
	Verified  bool
	IPAddress string

	Tickets []Ticket
}

func (Guest) GetGuestURL

func (g Guest) GetGuestURL() string

func (Guest) GetTicketURL

func (g Guest) GetTicketURL(slot time.Time) string

func (Guest) GetToken

func (g Guest) GetToken() string

func (*Guest) Validate

func (g *Guest) Validate() error

type Response

type Response struct {
	Success bool `json:"success"`

	// Timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
	Challenge string `json:"challenge_ts"`

	// The hostname of the site where the reCAPTCHA was solved
	Hostname string `json:"hostname"`

	// Optional list of error codes returned by the service
	ErrorCodes []string `json:"error-codes"`
}

Response is the JSON structure that is returned by the verification API after a challenge response is verified. @see https://developers.google.com/recaptcha/docs/verify#api-response

func CAPTCHAVerify

func CAPTCHAVerify(response string, remoteip string) (Response, error)

Verify the users's response to the reCAPTCHA challenge with the API server.

The parameter response is obtained after the user successfully solves the challenge presented by the JS widget. The remoteip parameter is optional; just send it empty if you don't want to use it.

CAPTCHAVerify function will return a boolean that will have the final result returned by the API as well as an optional list of errors. They might be useful for logging purposed but you don't have to show them to the user.

type Slot

type Slot struct {
	Slot             time.Time
	AvailableTickets int64
}

type SlotStat

type SlotStat struct {
	Slot             time.Time
	NumberTickets    int64
	AvailableTickets int64
	EventCode        string
}

type Ticket

type Ticket struct {
	Slot      time.Time
	Number    int64
	GuestID   string
	EventCode string
}

func (Ticket) TicketImageURL

func (t Ticket) TicketImageURL() string

Jump to

Keyboard shortcuts

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