routes

package
v0.0.0-...-fcc4a6d Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: ISC Imports: 28 Imported by: 0

Documentation

Overview

Package routes defines all the handling functions for all the routes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller holds all the variables needed for routes to perform their logic

func New

func New(db *gorm.DB, parser *parser.Parser, c config.Config, bundle *i18n.Bundle, sftpService *sftp.Service) Controller

New creates a new instance of the routes.Controller

func (Controller) Activate

func (controller Controller) Activate(c *gin.Context)

Activate handles requests used to activate a users account

func (Controller) Admin

func (controller Controller) Admin(c *gin.Context)

Admin renders the admin dashboard

func (Controller) Contact

func (controller Controller) Contact(c *gin.Context)

Contact ...

func (Controller) ContactPost

func (controller Controller) ContactPost(c *gin.Context)

ContactPost ...

func (Controller) DefaultPageData

func (controller Controller) DefaultPageData(c *gin.Context) PageData

func (Controller) Domain

func (controller Controller) Domain(c *gin.Context)

func (Controller) DomainScreenshot

func (controller Controller) DomainScreenshot(c *gin.Context)

func (Controller) DomainsReleasedSoon

func (controller Controller) DomainsReleasedSoon(c *gin.Context)

func (Controller) ForgotPassword

func (controller Controller) ForgotPassword(c *gin.Context)

ForgotPassword renders the HTML page where a password request can be initiated

func (Controller) ForgotPasswordPost

func (controller Controller) ForgotPasswordPost(c *gin.Context)

ForgotPasswordPost handles the POST request which requests a password reset and then renders the HTML page with the appropriate message

func (Controller) Index

func (controller Controller) Index(c *gin.Context)

Index renders the HTML of the index page

func (Controller) Language

func (controller Controller) Language(c *gin.Context)

func (Controller) Login

func (controller Controller) Login(c *gin.Context)

Login renders the HTML of the login page

func (Controller) LoginPost

func (controller Controller) LoginPost(c *gin.Context)

LoginPost handles login requests and returns the appropriate HTML and messages

func (Controller) Logout

func (controller Controller) Logout(c *gin.Context)

Logout deletes the current user session and redirects the user to the index page

func (Controller) Nameserver

func (controller Controller) Nameserver(c *gin.Context)

func (Controller) NoRoute

func (controller Controller) NoRoute(c *gin.Context)

NoRoute handles rendering of the 404 page

func (Controller) Register

func (controller Controller) Register(c *gin.Context)

Register renders the HTML content of the register page

func (Controller) RegisterPost

func (controller Controller) RegisterPost(c *gin.Context)

RegisterPost handles requests to register users and returns appropriate messages as HTML content

func (Controller) ResendActivation

func (controller Controller) ResendActivation(c *gin.Context)

ResendActivation renders the HTML page used to request a new activation email

func (Controller) ResendActivationPost

func (controller Controller) ResendActivationPost(c *gin.Context)

ResendActivationPost handles the post request for requesting a new activation email

func (Controller) ResetPassword

func (controller Controller) ResetPassword(c *gin.Context)

ResetPassword renders the HTML page for resetting the users password

func (Controller) ResetPasswordPost

func (controller Controller) ResetPasswordPost(c *gin.Context)

ResetPasswordPost handles post request used to reset users passwords

func (Controller) Search

func (controller Controller) Search(c *gin.Context)

Search renders the search HTML page and any search results

func (Controller) Sitemap

func (controller Controller) Sitemap(c *gin.Context)

func (Controller) SitemapDefault

func (controller Controller) SitemapDefault(c *gin.Context)

func (Controller) SitemapDomains

func (controller Controller) SitemapDomains(c *gin.Context)

func (Controller) SitemapNameservers

func (controller Controller) SitemapNameservers(c *gin.Context)

func (Controller) TopNameservers

func (controller Controller) TopNameservers(c *gin.Context)

func (Controller) Whois

func (controller Controller) Whois(c *gin.Context)

type DomainPageData

type DomainPageData struct {
	PageData
	FirstSeen      string
	HasNameservers bool
	Nameservers    []models.Nameserver
	HasReleaseAt   bool
	ReleaseAt      string
	HasParse       bool
	Screenshot     template.HTML
	PageSize       string
	LoadTime       string
	ParsedAt       string
}

type DomainReleaseData

type DomainReleaseData struct {
	PageData
	Domains []IndexDomain
	Prev    bool
	Next    bool
	PrevURL string
	NextURL string
}

type IndexCache

type IndexCache struct {
	Cached     time.Time
	IndexData  IndexData
	Generating bool
}

type IndexData

type IndexData struct {
	PageData
	Domains        []IndexDomain
	Nameservers    []IndexNameserver
	Search         string
	Min            string
	Max            string
	Extension      string
	Website        string
	Releasing      string
	Expiring       string
	NoSpecialChars string
	NoNumbers      string
	Count          map[int]string
}

type IndexDomain

type IndexDomain struct {
	Host       string
	URL        string
	ReleasesAt string
}

type IndexNameserver

type IndexNameserver struct {
	Host  string
	URL   string
	Count int64
}

type Message

type Message struct {
	Type    string // success, warning, error, etc.
	Content string
}

Message holds a message which can be rendered as responses on HTML pages

type NameserverPageData

type NameserverPageData struct {
	PageData
	FirstSeen  string
	HasDomains bool
	Domains    []SearchDomain
	Prev       bool
	Next       bool
	PrevURL    string
	NextURL    string
}

type PageData

type PageData struct {
	Title           string
	Messages        []Message
	IsAuthenticated bool
	CacheParameter  string
	Trans           func(s string) string
}

PageData holds the default data needed for HTML pages to render

type ResetPasswordPageData

type ResetPasswordPageData struct {
	PageData
	Token string
}

ResetPasswordPageData defines additional data needed to render the reset password page

type SearchData

type SearchData struct {
	PageData
	Results        []SearchDomain
	Prev           bool
	Next           bool
	PrevURL        string
	NextURL        string
	Search         string
	Min            string
	Max            string
	Extension      string
	Website        string
	Releasing      string
	Expiring       string
	NoSpecialChars string
	NoNumbers      string
	Count          map[int]string
}

SearchData holds additional data needed to render the search HTML page

type SearchDomain

type SearchDomain struct {
	Host       string
	URL        string
	ReleasedAt string
	Requested  string
	Status     string
}

type SearchQueryResult

type SearchQueryResult struct {
	Host       string
	ReleasedAt *time.Time
	Requested  *time.Time
	LoadTime   *float64
}

type TopNameserverCache

type TopNameserverCache struct {
	Cached time.Time
	Data   TopNameserversData
}

type TopNameserversData

type TopNameserversData struct {
	PageData
	Nameservers []IndexNameserver
	Prev        bool
	Next        bool
	PrevURL     string
	NextURL     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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