wom

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 25 Imported by: 0

README

Puzzad's Wise Old Man

Every adventurer needs a Wise Old Man to guide them. WOM is a small backend service that performs a number of useful functions for Puzzad that can't be done client-side or within the database:

  • Generates and validates captchas
  • Sends e-mail in response to contact/support/feedback forms
  • Accepts mailing list signups and unsubscribe requests
  • Manages payment workflows

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDatabase

func CloseDatabase()

func ConfirmMailingListSubscription

func ConfirmMailingListSubscription(w http.ResponseWriter, r *http.Request)

func ConnectToDatabase

func ConnectToDatabase() error

func EnsureMigrations

func EnsureMigrations() error

func ErrInternalError

func ErrInternalError(err error) render.Renderer

func ErrInvalidRequest

func ErrInvalidRequest(err error) render.Renderer

func SendContactForm

func SendContactForm(w http.ResponseWriter, r *http.Request)

func SendContactFormMail

func SendContactFormMail(ctx context.Context, email, name, message string) error

func SubscribeToMailingList

func SubscribeToMailingList(w http.ResponseWriter, r *http.Request)

func UnsubscribeFromMailingList

func UnsubscribeFromMailingList(w http.ResponseWriter, r *http.Request)

Types

type ErrResponse

type ErrResponse struct {
	Err            error `json:"-"`
	HTTPStatusCode int   `json:"-"`

	StatusText string `json:"status"`
	AppCode    int64  `json:"code,omitempty"`
	ErrorText  string `json:"error,omitempty"`
}

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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