app

package
v0.0.0-...-5798410 Latest Latest
Warning

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

Go to latest
Published: May 19, 2013 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CookieStore = sessions.NewCookieStore([]byte(conf.Config.SessionSecret))
View Source
var Panels = []AdminPanel{}

Functions

func AddPanel

func AddPanel(p AdminPanel)

func Attach

func Attach(url string)

Should have this to be an app.

func AttachAdmin

func AttachAdmin(url string)

func CreateUser

func CreateUser(username, password string) error

func FmtTimestamp

func FmtTimestamp(ts uint64) string

Format a timestamp into a simple date

func GetPost

func GetPost(route string, handler interface{})

func PageNumber

func PageNumber(page string) int

Return a number for a page (default to 1)

func PrettyPrint

func PrettyPrint(i interface{}) string

Attempt to PrettyPrint some things. Returns a string.

func RequireAuthentication

func RequireAuthentication(ctx *web.Context) bool

func Slugify

func Slugify(text string) string

Slugify some text. Do not strip words as django does, but do collapse spaces and use dashes in favor of all other non-alphanum characters.

func ValidateUser

func ValidateUser(username, password string) bool

Types

type AdminPanel

type AdminPanel interface {
	Render() string
}
type Link struct {
	Url    string
	Num    string
	HasUrl bool
	Inter  bool
}

type M

type M map[string]interface{}

type Paginator

type Paginator struct {
	Page       int
	PerPage    int
	Skip       int
	Limit      int
	Begin      int
	End        int
	Link       string
	WindowSize int
	HasPrev    bool
	HasNext    bool
	NumPages   int
	Inter      string
}

func NewPaginator

func NewPaginator(page, perPage int) *Paginator

func (*Paginator) Context

func (p *Paginator) Context(pageCount int) []string

func (*Paginator) Render

func (p *Paginator) Render(objCount int) string

given a maximum number of items, render pagination

type User

type User struct {
	Id       bson.ObjectId "_id"
	Username string
	Password string
}

func (*User) Collection

func (u *User) Collection() string

func (*User) Indexes

func (u *User) Indexes() [][]string

func (*User) PreSave

func (u *User) PreSave()

func (*User) Unique

func (u *User) Unique() bson.M

Jump to

Keyboard shortcuts

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