Documentation ¶
Index ¶
- func FilterPeersByQuery(q string, peers []wgtypes.Peer) []wgtypes.Peer
- func GetExternalIP() (string, error)
- func GetInterfaceIPs(name string) (addresses []string, err error)
- func GetPeerQuickConfig(device wgtypes.Device, peer wgtypes.Peer, options PeerQuickConfigOptions) (io.Reader, error)
- func SortPeersByField(field string, peers []wgtypes.Peer) error
- type Paginator
- func (p *Paginator) HasNext() bool
- func (p *Paginator) HasPages() bool
- func (p *Paginator) HasPrev() bool
- func (p *Paginator) IsActive(page int) bool
- func (p *Paginator) Nums() int64
- func (p *Paginator) Offset() int
- func (p *Paginator) Page() int
- func (p *Paginator) PageLink(page int) string
- func (p *Paginator) PageLinkFirst() (link string)
- func (p *Paginator) PageLinkLast() (link string)
- func (p *Paginator) PageLinkNext() (link string)
- func (p *Paginator) PageLinkPrev() (link string)
- func (p *Paginator) PageNums() int
- func (p *Paginator) Pages() []int
- func (p *Paginator) SetNums(nums interface{})
- func (p *Paginator) Write(response *echo.Response)
- type PeerQuickConfigOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExternalIP ¶
func GetInterfaceIPs ¶
func GetPeerQuickConfig ¶
Types ¶
type Paginator ¶
type Paginator struct { Request *http.Request PerPageNums int MaxPages int // contains filtered or unexported fields }
Paginator within the state of a http request.
func NewPaginator ¶
NewPaginator Instantiates a paginator struct for the current http request.
func (*Paginator) IsActive ¶
IsActive Returns true if the given page index points to the current page.
func (*Paginator) PageLinkFirst ¶
PageLinkFirst Returns URL to the first page.
func (*Paginator) PageLinkLast ¶
PageLinkLast Returns URL to the last page.
func (*Paginator) PageLinkNext ¶
PageLinkNext Returns URL to the next page.
func (*Paginator) PageLinkPrev ¶
PageLinkPrev Returns URL to the previous page.
func (*Paginator) Pages ¶
Pages Returns a list of all pages.
Usage (in a view template):
{{range $index, $page := .paginator.Pages}} <li{{if $.paginator.IsActive .}} class="active"{{end}}> <a href="{{$.paginator.PageLink $page}}">{{$page}}</a> </li> {{end}}
Click to show internal directories.
Click to hide internal directories.