Documentation ¶
Index ¶
- func GetTicketResponsesByTicketID(db *sql.DB, ticketID int) ([]string, error)
- func InsertNewTicket(w http.ResponseWriter, r *http.Request)
- func InsertNewTicketInDB(db *sql.DB, username, title, text string) (string, error)
- func InsertNewTicketResponse(w http.ResponseWriter, r *http.Request)
- func InsertNewTicketResponseInDB(db *sql.DB, ticketID, userID int, text string) error
- func NewTicket(w http.ResponseWriter, r *http.Request)
- func Support(w http.ResponseWriter, r *http.Request)
- func Ticket(w http.ResponseWriter, r *http.Request)
- type Page
- type PageData
- type TicketData
- type TicketPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTicketResponsesByTicketID ¶
GetTicketResponsesByTicketID gets all of the responses for a ticket by its ticket id. Should only interact with the database.
func InsertNewTicket ¶
func InsertNewTicket(w http.ResponseWriter, r *http.Request)
InsertNewTicket endpoint parses the data from the user and inserts the new ticket in the database.
func InsertNewTicketInDB ¶
InsertNewTicketInDB only uses database functions and inserts the new ticket into the database as well as the first customer message as a ticket_response. Returns the slug and potential error.
func InsertNewTicketResponse ¶
func InsertNewTicketResponse(w http.ResponseWriter, r *http.Request)
InsertNewTicketResponse endpoint parses the data when responding to a ticket and inserts the new data into the database.
func InsertNewTicketResponseInDB ¶
InsertNewTicketResponseInDB inserts a new ticket response into the database based on the userID and ticketID.
func NewTicket ¶
func NewTicket(w http.ResponseWriter, r *http.Request)
NewTicket endpoint rendering page to create a new customer support ticket. Has no other dynamic data than the "standard" data such as username.
Types ¶
type Page ¶
Page struct is used for generic data to be rendered in HTML and should not be used in other structs.
type PageData ¶
type PageData struct { Title string Paths []helpers.Path Tickets []TicketData }
PageData struct is used for the data being rendered and should not be used in other structs.
type TicketData ¶
TicketData struct is used for storing data related to Customer Support Tickets.
func GetTicketBySlug ¶
GetTicketBySlug gets individual ticket by its slug. Should only interact with the database.
func GetTicketsByUsername ¶
func GetTicketsByUsername(db *sql.DB, username string) ([]TicketData, error)
GetTicketsByUsername gets tickets associated with the username variable sent in.
type TicketPage ¶
type TicketPage struct { Title string Paths []helpers.Path Ticket TicketData Responses []string }
TicketPage struct is used for rendering the data for an individual ticket with a ticket and all of its responses.