supports

package
v0.0.0-...-f26991d Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyPage = &Page{Collection: make([](interface{}), 0)}

Functions

This section is empty.

Types

type Og

type Og struct {
	Title       string
	Type        string
	Url         string
	Image       string
	SiteName    string
	Description string
}

Og Meta Data

type Pagable

type Pagable interface {
	Count() (int, error)
	List(offset int, per_page int) ([]interface{}, error)
}

type Page

type Page struct {
	Current      int
	Total        int
	Next         int
	HasNext      bool
	Previous     int
	HasPrevious  bool
	Collection   []interface{}
	ItemsTotal   int
	ItemsPerPage int
	ItemsOffset  int
}

Page is an abstract data model that supports pagination. If your data access driver implments Pagable interface you'll get the page object by using NewPage() function and feel easy to build paginated HTML.

func NewPage

func NewPage(current, pp int, query Pagable) (*Page, error)

Build a new Page object. current is the current index for the Page and pp should the number of items per page.

Directories

Path Synopsis
github package provides an API client for github.com Copyright (C) 2014 Yohei Sasaki Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
github package provides an API client for github.com Copyright (C) 2014 Yohei Sasaki Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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