app

package
v0.0.0-...-712f093 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2015 License: GPL-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ItWorks string = `` /* 510-byte string literal not displayed */
View Source
var PagesOffset int64 = 0
View Source
var PagesSize int64 = 20

Functions

This section is empty.

Types

type Application

type Application struct {
	sync.RWMutex
	log.Logger

	// option & config
	Options *Options
	Configs *CONFIG
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(options *Options, configs *CONFIG, logger log.Logger) *Application

func (*Application) Exit

func (app *Application) Exit()

func (*Application) Init

func (app *Application) Init() error

func (*Application) Main

func (app *Application) Main()

func (*Application) Refresh

func (app *Application) Refresh()

func (*Application) Version

func (app *Application) Version(version string)

type ByAsc

type ByAsc []Click

func (ByAsc) Len

func (a ByAsc) Len() int

func (ByAsc) Less

func (a ByAsc) Less(i, j int) bool

func (ByAsc) Swap

func (a ByAsc) Swap(i, j int)

type ByDesc

type ByDesc []Click

func (ByDesc) Len

func (a ByDesc) Len() int

func (ByDesc) Less

func (a ByDesc) Less(i, j int) bool

func (ByDesc) Swap

func (a ByDesc) Swap(i, j int)

type CONFIG

type CONFIG struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func DefaultCONFIG

func DefaultCONFIG() *CONFIG

func LoadCONFIG

func LoadCONFIG(fn string) (*CONFIG, error)

func NewCONFIG

func NewCONFIG() *CONFIG

func (*CONFIG) Bool

func (c *CONFIG) Bool(option string) (result, found bool)

func (*CONFIG) BoolDefault

func (c *CONFIG) BoolDefault(option string, dfault bool) bool

func (*CONFIG) Duration

func (c *CONFIG) Duration(option string) (result time.Duration, found bool)

func (*CONFIG) DurationDefault

func (c *CONFIG) DurationDefault(option string, dfault time.Duration) time.Duration

func (*CONFIG) Float

func (c *CONFIG) Float(option string) (result float64, found bool)

func (*CONFIG) FloatDefault

func (c *CONFIG) FloatDefault(option string, dfault float64) float64

func (*CONFIG) HasSection

func (c *CONFIG) HasSection(section string) bool

func (*CONFIG) Int

func (c *CONFIG) Int(option string) (result int, found bool)

func (*CONFIG) IntDefault

func (c *CONFIG) IntDefault(option string, dfault int) int

func (*CONFIG) MultiString

func (c *CONFIG) MultiString(option string, sep string) ([]string, bool)

func (*CONFIG) MultiStringDefault

func (c *CONFIG) MultiStringDefault(option, sep string, dfault []string) []string

func (*CONFIG) Options

func (c *CONFIG) Options(prefix string) []string

Options returns all configuration option keys. If a prefix is provided, then that is applied as a filter.

func (*CONFIG) Raw

func (c *CONFIG) Raw() *config.Config

func (*CONFIG) Save

func (c *CONFIG) Save(fn string) error

func (*CONFIG) SetOption

func (c *CONFIG) SetOption(name, value string)

func (*CONFIG) SetSection

func (c *CONFIG) SetSection(section string)

func (*CONFIG) String

func (c *CONFIG) String(option string) (result string, found bool)

func (*CONFIG) StringDefault

func (c *CONFIG) StringDefault(option, dfault string) string

type Click

type Click struct {
	URI   string `object:"uri"`
	Count int64  `object:"count"`
}

type Options

type Options struct {
	HTTPAddress     string
	HTTPSAddress    string
	AppID           string
	AppSecret       string
	StaticRoot      string
	MarkdownRoot    string
	TemplateRoot    string
	LogsRoot        string
	StorageRoot     string
	IndexesRoot     string
	TempRoot        string
	Root            string
	StorageMax      uint64
	RefreshInterval time.Duration
}

func NewOptions

func NewOptions(host string, port int) *Options

func (*Options) Prepare

func (opt *Options) Prepare(workdir string) error

func (*Options) SetApplication

func (opt *Options) SetApplication(appid, secret string)

func (*Options) SetRefreshDefault

func (opt *Options) SetRefreshDefault(s string, default_refresh time.Duration)

func (*Options) SetStorargeMax

func (opt *Options) SetStorargeMax(s string) error

type OrderBy

type OrderBy struct {
	Field  string
	Ascend bool
}

type Pages

type Pages struct {
	// contains filtered or unexported fields
}

func NewPages

func NewPages(uri string, ctx *context) *Pages

func (*Pages) All

func (pages *Pages) All() []*page.Page

func (*Pages) Limit

func (pages *Pages) Limit(offset, size int64) []*page.Page

func (*Pages) Nested

func (pages *Pages) Nested(flag bool) *Pages

func (*Pages) OrderBy

func (pages *Pages) OrderBy(field string, asc bool) *Pages

func (*Pages) Pagination

func (pages *Pages) Pagination(url string, size int) []*PaginationItem

func (*Pages) Query

func (pages *Pages) Query(json string) *Pages

func (*Pages) QueryDatetimeRange

func (pages *Pages) QueryDatetimeRange(field, start, end string) *Pages

func (*Pages) QueryDatetimeRangeInclusive

func (pages *Pages) QueryDatetimeRangeInclusive(field, start, end string, startInc bool, endInc bool) *Pages

func (*Pages) QueryMatch

func (pages *Pages) QueryMatch(field string, match string) *Pages

func (*Pages) QueryMatchPhrase

func (pages *Pages) QueryMatchPhrase(field string, phrase string) *Pages

func (*Pages) QueryNumberRange

func (pages *Pages) QueryNumberRange(field string, start, end interface{}) *Pages

func (*Pages) QueryNumberRangeInclusive

func (pages *Pages) QueryNumberRangeInclusive(field string, start, end interface{}, startInc bool, endInc bool) *Pages

func (*Pages) QueryRegexp

func (pages *Pages) QueryRegexp(field string, regex string) *Pages

func (*Pages) QueryString

func (pages *Pages) QueryString(field string, str string) *Pages

func (*Pages) QueryTerm

func (pages *Pages) QueryTerm(field string, term string) *Pages

func (*Pages) QueryTermPrefix

func (pages *Pages) QueryTermPrefix(field string, prefix string) *Pages

func (*Pages) Total

func (pages *Pages) Total() int

type PaginationItem

type PaginationItem struct {
	PageNo   int
	PageSize int
	PageLink string
}

func NewPaginationItem

func NewPaginationItem(no int, size int, url string) *PaginationItem

type QRCode

type QRCode struct {
	Value string
	File  string
	Link  string
}

Jump to

Keyboard shortcuts

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