Documentation ¶
Index ¶
- func CloseDbConnection(db *sql.DB)
- func ConnectToDB(host string, dbname string, user string, password string, port int64)
- func CreateCampaignAndMailingList(mailingListName string, campaignName string, businessID string) (MailingList, Campaign, error)
- func GetMailingList(mailingListID string, c *gin.Context) (MailingList, []Customer, error)
- func UnlinkCustomerMailingList(customerID string, mailingListID string) error
- func VerifyUserCredentials(email string, password string) (bool, error)
- type Business
- type Campaign
- type Customer
- type MailingList
- type MailingListCustomerLink
- type SavedUser
- type UnSavedUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseDbConnection ¶
CloseDbConnection will end dialogue with the DB Recommanded to use at program's end
func ConnectToDB ¶
ConnectToDB Set up connection to the postgres DB Will panic on error
func CreateCampaignAndMailingList ¶
func CreateCampaignAndMailingList(mailingListName string, campaignName string, businessID string) (MailingList, Campaign, error)
CreateCampaignAndMailingList will add a new Campaign and a new mailingList to the DB
func GetMailingList ¶
GetMailingList will get information from a mailingList and it's customers
func UnlinkCustomerMailingList ¶
UnlinkCustomerMailingList will remove a customer from a mailing list
Types ¶
type Business ¶
Business represent the business type
func CreateBusiness ¶
CreateBusiness will add a new business to the DB
func GetBusiness ¶
GetBusiness will return a business from it's ID from the DB
func GetBusinessByName ¶
GetBusinessByName will return a business from it's ID from the DB
type Campaign ¶
Campaign Represents a mail campaign
func CreateCampaignWithExistingMailingList ¶
func CreateCampaignWithExistingMailingList(campaignName string, mailingListID string, businessID string) (Campaign, error)
CreateCampaignWithExistingMailingList will add a new Campaign to the DB with an existing mailingList
func GetBusinessCampaigns ¶
GetBusinessCampaigns will get all campaigns from a business
func GetCampaign ¶
GetCampaign will add a get information from a campaign
type Customer ¶
Customer type
func CreateAndLinkCustomer ¶
func CreateAndLinkCustomer(email string, name string, surname string, businessID string, mailingListID string) (Customer, error)
CreateAndLinkCustomer will add a new customer and link it to a mailing list in the DB
func CreateCustomer ¶
CreateCustomer will add a new customer to the DB
func GetCustomer ¶
GetCustomer will get a customer from the DB
type MailingList ¶
MailingList type
func CreateMailingList ¶
func CreateMailingList(mailingListName string, businessID string) (MailingList, error)
CreateMailingList will add a new mailingList to the DB
type MailingListCustomerLink ¶
MailingListCustomerLink type
type SavedUser ¶
SavedUser represent the user's type after they are saved in the DB
func CreateUser ¶
CreateUser will add a new user to the DB