weburl

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountRegistrationConfirm : key of the web url
	AccountRegistrationConfirm = "account.registration.confirm"

	// AccountRegistrationCancel : key of the web url
	AccountRegistrationCancel = "account.registration.cancel"

	// AccountLoginCancel : key of the web url
	AccountLoginCancel = "account.login.cancel"

	// AccountProfile : key of the web url
	AccountProfile = "account.profile"

	// AccountUnsubscribe : key of the web url
	AccountUnsubscribe = "account.unsubscribe"

	// AccountForgotPasswordConfirm : key of the web url
	AccountForgotPasswordConfirm = "account.forgot_password.confirm"

	// AccountForgotPasswordCancel : key of the web url
	AccountForgotPasswordCancel = "account.forgot_password.cancel"

	// AccountUpdateEmailAddressConfirm : key of the web url
	AccountUpdateEmailAddressConfirm = "account.update_email_address.confirm"

	// AccountUpdateEmailAddressCancel : key of the web url
	AccountUpdateEmailAddressCancel = "account.update_email_address.cancel"

	// AccountUpdatePasswordConfirm : key of the web url
	AccountUpdatePasswordConfirm = "account.update_password.confirm"

	// AccountUpdatePasswordCancel : key of the web url
	AccountUpdatePasswordCancel = "account.update_password.cancel"

	// AccountValidateNewEmailAddress : key of the web url
	AccountValidateNewEmailAddress = "account.validate_email_address"

	// AccountDeleteConfirm  : key of the web url
	AccountDeleteConfirm = "account.delete.confirm"

	// AccountDeleteCancel  : key of the web url
	AccountDeleteCancel = "account.delete.cancel"

	// AccountDisableConfirm  : key of the web url
	AccountDisableConfirm = "account.disable.confirm"

	// AccountDisableCancel  : key of the web url
	AccountDisableCancel = "account.disable.cancel"
)

Variables

This section is empty.

Functions

func GetURL

func GetURL(key, locale string) string

GetURL : returns the full URL of a web route.

func Initialize

func Initialize(file, webHost string) bool

Initialize : initializes the configuration of the routes.

Types

type Configuration

type Configuration struct {
	Routes map[string]Route `yaml:"routes"` // The index is the unique key of the route (i.e. "account.registration").
}

Configuration : struct of the configuration of the routes.

var Main *Configuration

Main : list of the routes.

func NewConfiguration

func NewConfiguration() (conf *Configuration)

NewConfiguration : returns a Configuration struct.

func (*Configuration) GetURL

func (conf *Configuration) GetURL(key, locale string) string

GetURL : returns the full URL of a web route.

func (*Configuration) Initialize

func (conf *Configuration) Initialize(file, webHost string) bool

Initialize : initializes the configuration of the routes.

type Route

type Route struct {
	RelativePaths map[string]string `yaml:"paths"`
	AbsolutePaths map[string]string `yaml:"-"` // The index is the locale of the route (i.e. "fr-fr"), the value is the localized route (i.e. "http://.../account/registration").
	Sitemap       html.Sitemap      `yaml:"sitemap"`
}

Route : struct of a web route

func (*Route) HasVariable

func (route *Route) HasVariable() bool

HasVariable : returns true if the route is a generic path, is it contains some variables.

Jump to

Keyboard shortcuts

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