Documentation
¶
Index ¶
- Constants
- Variables
- func Config(f cli.ActionFunc) cli.ActionFunc
- func DataSource() string
- func Home() string
- func Inject(f func(*cli.Context, *inject.Graph) error) cli.ActionFunc
- func IsProduction() bool
- func Main() error
- func Name() string
- func Random(n int) string
- func Register(args ...Plugin)
- func Shell(cmd string, args ...string) error
- func Template(w io.Writer, n string, d interface{}) error
- func Walk(f func(Plugin) error) error
- type Model
- type Pagination
- type Plugin
- type Wrap
- func (p *Wrap) FORM(fm interface{}, ...) gin.HandlerFunc
- func (p *Wrap) HTML(t string, f func(*gin.Context, string) (gin.H, error)) gin.HandlerFunc
- func (p *Wrap) JSON(f func(*gin.Context, string) (interface{}, error)) gin.HandlerFunc
- func (p *Wrap) Redirect(f func(*gin.Context, string) (string, error)) gin.HandlerFunc
- func (p *Wrap) XML(f func(*gin.Context, string) (interface{}, error)) gin.HandlerFunc
Constants ¶
View Source
const ( // TypeMARKDOWN markdown format TypeMARKDOWN = "markdown" // TypeHTML html format TypeHTML = "html" )
View Source
const (
// FormatDateInput format for date input
FormatDateInput = "2006-01-02"
)
Variables ¶
Functions ¶
Types ¶
type Model ¶
type Model struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"createdAt"` 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
type Plugin ¶
type Plugin interface { Init() Mount(*gin.Engine) Open(*inject.Graph) error Console() []cli.Command Atom(lang string) ([]*atom.Entry, error) Sitemap(languages ...string) ([]stm.URL, error) Workers() map[string]job.Handler }
Plugin plugin
type Wrap ¶
Wrap wrap
func (*Wrap) FORM ¶
func (p *Wrap) FORM(fm interface{}, fn func(*gin.Context, string, interface{}) (interface{}, error)) gin.HandlerFunc
FORM wrap form handler
Source Files
¶
Click to show internal directories.
Click to hide internal directories.