Documentation ¶
Index ¶
- Variables
- type Dispatcher
- type Info
- type Subdomains
- func (s *Subdomains) Add(name string, e *echo.Echo) *Subdomains
- func (s *Subdomains) DefaultDispatcher(r engine.Request, w engine.Response) (*echo.Echo, bool)
- func (s *Subdomains) FindByDomain(host string) (*echo.Echo, bool)
- func (s *Subdomains) Get(args ...string) *Info
- func (s *Subdomains) Run(args ...interface{})
- func (s *Subdomains) ServeHTTP(r engine.Request, w engine.Response)
- func (s *Subdomains) SetDebug(on bool) *Subdomains
- func (s *Subdomains) SetDispatcher(dispatcher Dispatcher) *Subdomains
- func (s *Subdomains) URL(purl string, args ...string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = New()
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶ added in v1.4.0
type Subdomains ¶
type Subdomains struct { Hosts map[string]string //{host:name} Alias map[string]*Info Default string //default name Protocol string //http/https Boot string // contains filtered or unexported fields }
func New ¶
func New() *Subdomains
func (*Subdomains) Add ¶
func (s *Subdomains) Add(name string, e *echo.Echo) *Subdomains
Add 添加子域名,name的值支持以下三种格式: 1. 别名@域名 ———— 一个别名可以对应多个域名,每个域名之间用半角逗号“,”分隔 2. 域名 ———— 可以添加多个域名,每个域名之间用半角逗号“,”分隔。这里会自动将第一个域名中的首个点号“.”前面的部分作为别名,例如“blog.webx.top,news.webx.top”会自动将“blog”作为别名 3. 别名 ———— 在不指定域名的情况下将无法访问,除非“默认访问别名”(Subdomains.Default的值)与此相同
func (*Subdomains) DefaultDispatcher ¶ added in v1.4.0
func (*Subdomains) FindByDomain ¶
func (s *Subdomains) FindByDomain(host string) (*echo.Echo, bool)
func (*Subdomains) Get ¶
func (s *Subdomains) Get(args ...string) *Info
func (*Subdomains) Run ¶
func (s *Subdomains) Run(args ...interface{})
func (*Subdomains) SetDebug ¶ added in v1.4.1
func (s *Subdomains) SetDebug(on bool) *Subdomains
func (*Subdomains) SetDispatcher ¶ added in v1.4.0
func (s *Subdomains) SetDispatcher(dispatcher Dispatcher) *Subdomains
Click to show internal directories.
Click to hide internal directories.