shared

package
v0.0.0-...-5167b14 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOST_RECENT  = 0
	OFFSET_PARAM = "offset"
	LIMIT_PARAM  = "limit"

	MARKDOWN_PARAM = "markdown"
)
View Source
const SHORT_LIMIT = 480

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Id         int64 `qbs:"pk"`
	Title      string
	Updated    time.Time
	Created    time.Time
	Text       string
	TextShort  string
	AuthorUdid string `qbs:"fk:Author"`
	Author     *UserRecord
}

type URLGenerator

type URLGenerator interface {
	IndexPage() string
	LoginPage() string
	SignupPage() string
	Auth() string
	Me() string
	UserRecord(udid string) string
	UserRecordResource() string
	PostResource() string
	Posts(offset int, limit int) string
	Post(id int64, wantMarkdown bool) string
	PostView(id int64) string
	PostEdit(id int64) string
	NewPost() string
}

A UrlGenerator is a utility type to insure that all your code can easily "agree" on the URLs inside your application.

var URLGen URLGenerator

URLGen is an implementation of URLGenerator for this application. It is visible to both the client and the server and should be used for creating paths within the application.

type UserRecord

type UserRecord struct {
	UserUdid  string `qbs:"pk"`
	FirstName string
	LastName  string
	EmailAddr string
	Password  string
	Admin     bool
}

Jump to

Keyboard shortcuts

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