web

package
v0.0.0-...-beacdf2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeMARKDOWN markdown format
	TypeMARKDOWN = "markdown"
	// TypeHTML html format
	TypeHTML = "html"
	// TypeTEXT text format
	TypeTEXT = "text"
)
View Source
const (
	// LayoutApplication application layout
	LayoutApplication = "layouts/application/index"
)

Variables

View Source
var (
	// Version version
	Version string
	// BuildTime build time
	BuildTime string
	// Usage usage
	Usage string
	// Copyright copyright
	Copyright string
	// AuthorName author's name
	AuthorName string
	// AuthorEmail author's email
	AuthorEmail string
)

Functions

func Config

func Config(f cli.ActionFunc) cli.ActionFunc

Config load config first

func Home

func Home() string

Home home url

func Inject

func Inject(f func(*cli.Context, *inject.Graph) error) cli.ActionFunc

Inject inject objects first

func IsProduction

func IsProduction() bool

IsProduction production mode ?

func Main

func Main() error

Main The entry

func Name

func Name() string

Name get server.name

func Random

func Random(n int) string

Random randome string

func Register

func Register(args ...Plugin)

Register register plugins

func Shell

func Shell(cmd string, args ...string) error

Shell exec shell command

func Walk

func Walk(f func(Plugin) error) error

Walk walk plugins

Types

type Media

type Media struct {
	Model
	Body string `json:"body"`
	Type string `json:"type"`
}

Media media

type Model

type Model struct {
	Timestamp
	UpdatedAt time.Time `json:"updatedAt"`
}

Model base model

type Pagination

type Pagination struct {
	Href  string        `json:"href"`
	Page  int64         `json:"page"`
	Size  int64         `json:"size"`
	Total int64         `json:"total"`
	Count int64         `json:"count"`
	Items []interface{} `json:"items"`
	Ids   []int64       `json:"ids"`
}

Pagination pagination

func NewPagination

func NewPagination(r *http.Request, total int64) *Pagination

NewPagination new pagination

func (*Pagination) Limit

func (p *Pagination) Limit() int64

Limit limit

func (*Pagination) Offset

func (p *Pagination) Offset() int64

Offset offset

type Plugin

type Plugin interface {
	Mount(*axe.Router)
	Open(*inject.Graph) error
	Console() []cli.Command
	Atom(lang string) ([]*atom.Entry, error)
	Sitemap() ([]stm.URL, error)
	Workers() map[string]job.Handler
}

Plugin plugin

type Timestamp

type Timestamp struct {
	ID        uint      `gorm:"primary_key" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
}

Timestamp timestamp

Jump to

Keyboard shortcuts

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