pages

package
v0.0.0-...-9abda77 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LoginFailedPage = "/auth/login/failed"
View Source
const LoginOkPage = "/auth/login_ok"
View Source
const LoginPageTemplate = "login"

LoginPageTemplate is the Name of the Template file

View Source
const RegisterOkPage = "/auth/user_registered"
View Source
const RegisterPageTemplate = "register"

RegisterPageTemplate is the Name of the Template file

Variables

View Source
var UrlNameAlreadyRegisteredError = errors.New("Url name already registered")

UrlNameAlreadyRegisteredError is the Error to mark that a URL was tried to be overwritten

Functions

func AddNewUser

func AddNewUser(ctx context.Context, hndl *db.Db, u *model.User) (string, error)

AddNewUser adds a User in a given Format to the Database

Types

type Defaults

type Defaults struct {
	Title        string
	LangShort    string
	TemplateName string
}

Defaults are Default values for all Page Structs

type LoginForm

type LoginForm struct {
	UsernameField string
	PasswordField string
	UsernameName  string
	PasswordName  string
	SubmitName    string
	Challenge     string
}

type LoginPage

type LoginPage struct {
	Defaults
	LoginForm
	Headline    string
	Description string
}

LoginPage are the Values for the Login Template

func GetLoginPageValues

func GetLoginPageValues() *LoginPage

GetLoginPageValues provides Default Values for the Login Page

type PostRegisterPage

type PostRegisterPage struct {
	Defaults
	Message string
}

func GetPostRegisterValues

func GetPostRegisterValues() *PostRegisterPage

GetPostRegisterValues provides default values for Register Page

type RegisterForm

type RegisterForm struct {
	NameField               string
	NameName                string
	PasswordFieldValidation string
	PasswordValidationName  string
	UsernameField           string
	PasswordField           string
	UsernameName            string
	PasswordName            string
	SubmitName              string
	PasswordNote            string
	PasswordValidationInfo  string
	RegisterMailSender      string
	PhoneField              string
	RegisterService         string
	Challenge               string
}

func (*RegisterForm) GetUserFromForm

func (rf *RegisterForm) GetUserFromForm(v url.Values) *model.User

func (*RegisterForm) GetUserFromJson

func (rf *RegisterForm) GetUserFromJson(m map[string]interface{}) (*model.User, error)

type RegisterMail

type RegisterMail struct {
	util.MailTemplateDefaults
	RegistrationID string
}

func GetRegisterFormMailData

func GetRegisterFormMailData(u *model.User) *RegisterMail

type RegisterPage

type RegisterPage struct {
	Defaults
	RegisterForm
	Headline    string
	Description string
}

RegisterPage are the Values for the register Template

func GetRegisterPageValues

func GetRegisterPageValues() *RegisterPage

type Urls

type Urls struct {
	// contains filtered or unexported fields
}
var PortalUrls Urls

PortalUrls Map to hold all Urls registered in the Portal

func (*Urls) Add

func (u *Urls) Add(name string, url string) error

Add a Item to the Urls Map

func (*Urls) Get

func (u *Urls) Get(name string) string

Get returns the name of a given Url Name

Jump to

Keyboard shortcuts

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