Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockList ¶
type BlockList struct {
// contains filtered or unexported fields
}
BlockList type Supports wildcard domains like "*.example.com" to block all subdomains. Supports suffix wildcards like "*-ad.example.com" to block domains ending with "-ad.example.com".
type DBAuthor ¶
type DBAuthor struct {
Repo TicketRepo
}
type FileAuther ¶
type FileAuther struct {
Path string
// contains filtered or unexported fields
}
func (*FileAuther) Load ¶
func (a *FileAuther) Load() error
type FileLoader ¶
type FileLoader struct {
// contains filtered or unexported fields
}
func NewFileLoader ¶
func NewFileLoader() *FileLoader
func (*FileLoader) Loop ¶
func (l *FileLoader) Loop()
func (*FileLoader) Start ¶
func (l *FileLoader) Start()
func (*FileLoader) Stop ¶
func (l *FileLoader) Stop()
func (*FileLoader) Watch ¶
func (l *FileLoader) Watch(file string, cb func(file string))
type Handler ¶
func (*Handler) ServeMetrics ¶
func (h *Handler) ServeMetrics(w http.ResponseWriter, r *http.Request)
type Pay ¶
type Ticket ¶
type Ticket struct {
ID int `db:"id" json:"id"`
Token string `db:"token" json:"-"`
Cents int `db:"cents" json:"cents"`
Tier int `db:"tier" json:"tier"`
PayOrder string `db:"pay_order" json:"pay_order"` // 商户订单号
BuyOrder string `db:"buy_order" json:"buy_order"` // 支付宝交易号
Created time.Time `db:"created" json:"created"`
Updated time.Time `db:"updated" json:"updated"`
Expires time.Time `db:"expires" json:"expires"`
}
type TicketHandler ¶
type TicketHandler struct {
Pay Pay
Repo TicketRepo
AltSvc string
Nodes []Node
}
func (*TicketHandler) GetMyNodes ¶
func (h *TicketHandler) GetMyNodes(w http.ResponseWriter, r *http.Request)
func (*TicketHandler) ServeHTTP ¶
func (h *TicketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TicketRepo ¶
type TicketRepo interface {
// 新增购买记录
NewTicket(ticket Ticket) error
// List fetches all current Tickets with bytes available.
List(token string, limit int) ([]Ticket, error)
}
func NewTicketRepo ¶
func NewTicketRepo(path string) TicketRepo
Source Files
¶
Click to show internal directories.
Click to hide internal directories.