Documentation
¶
Overview ¶
Package prago is MVC framework for go
Index ¶
- Variables
- func AddResourceCustomSearchFunction[T any](app *App, fn func(q string, userData UserData) []*T)
- func Cached[T any](app *App, name string, createFn func() T) chan T
- func CreateItem[T any](app *App, item *T) error
- func CreateItemWithContext[T any](ctx context.Context, app *App, item *T) error
- func CreateWithLog[T any](item *T, request *Request) error
- func DeleteItem[T any](app *App, id int64) error
- func DeleteItemWithContext[T any](ctx context.Context, app *App, id int64) error
- func DeleteWithLog[T any](item *T, request *Request) error
- func ForEach[T any](app *App, ctx context.Context, handler func(*T) error) error
- func IsEmailValid(email string) bool
- func IsPhoneNumberValid(phone string) bool
- func ItemStatistic[T any](app *App, name func(string) string, permission Permission, ...)
- func MultirelationArrayToString(in []int64) string
- func MultirelationStringToArray(in string) (ret []int64)
- func PreviewURLFunction[T any](app *App, fn func(*T) string)
- func Replace[T any](ctx context.Context, app *App, item *T) error
- func UpdateItem[T any](app *App, item *T) error
- func UpdateItemWithContext[T any](ctx context.Context, app *App, item *T) error
- func UpdateWithLog[T any](item *T, request *Request) error
- func ValidateDelete[T any](app *App, fn func(item *T, validation Validation, userData UserData))
- func ValidateUpdate[T any](app *App, fn func(item *T, validation Validation, userData UserData))
- type API
- type Accordion
- type Action
- func ActionForm(app *App, url string, formGenerator func(form *Form, request *Request), ...) *Action
- func ActionPlain(app *App, url string, handler func(*Request)) *Action
- func ActionResourceForm[T any](app *App, url string, formGenerator func(form *Form, request *Request), ...) *Action
- func ActionResourceItemForm[T any](app *App, url string, ...) *Action
- func ActionResourceItemPlain[T any](app *App, url string, fn func(*T, *Request)) *Action
- func ActionResourceItemUI[T any](app *App, url string, ...) *Action
- func ActionResourceMultipleItemsForm[T any](app *App, url string, ...) *Action
- func ActionResourcePlain[T any](app *App, url string, handler func(*Request)) *Action
- func ActionResourceUI[T any](app *App, url string, content func(*Request) template.HTML) *Action
- func ActionUI(app *App, url string, content func(*Request) template.HTML) *Action
- func PopupForm(app *App, url string, formGenerator func(*Form, *Request), ...) *Action
- type Activity
- type Aggregation
- type App
- func (app *App) API(url string) *API
- func (app *App) AddCSS(fn func() string)
- func (app *App) AddCustomSearchFunction(fn func(q string, userData UserData) []*CustomSearchResult)
- func (app *App) AddDevStaticFiles(path string)
- func (app *App) AddEnumFieldType(name string, items [][2]string)
- func (app *App) AddEnumFieldTypeLocalized(name string, items []FieldTypeEnum)
- func (app *App) AddJavascript(fn func() string)
- func (app *App) AddLessDevelopmentPaths(sourcePath, targetPath string)
- func (app *App) AddManagerOfRole(whoRole, whomRole string)
- func (app *App) AddPragoDevelopmentPath(path string)
- func (app *App) AddSassDevelopmentPaths(sourcePath, targetPath string)
- func (app *App) AddServerSetup(fn func(*http.Server))
- func (app *App) AddStaticFiles(f fs.FS, pathPrefix string)
- func (app *App) AddTemplatesDevelopmentPath(templates *PragoTemplates, watchPath string, matchPatterns ...string)
- func (app *App) AddTypeScriptDevelopmentPath(path string)
- func (app *App) AfterAction(fn func(p *Request))
- func (app *App) BaseURL() string
- func (app *App) BeforeAction(fn func(p *Request))
- func (app *App) ClearCache()
- func (app *App) DevelopmentMode() bool
- func (app *App) Email() *Email
- func (app *App) FormFilter() *FormFilter
- func (app *App) GenerateCSRFToken(userID int64) string
- func (app *App) GetAdminTemplates() *PragoTemplates
- func (app *App) GetAllUsers() (ret []UserData)
- func (app *App) GetAppInfo() AppInfo
- func (app *App) GetCDNVideoURL(uuid string) string
- func (app *App) GetCachedUserEmail(id int64) string
- func (app *App) GetDB() *sql.DB
- func (app *App) GetFiles(ctx context.Context, ids string) []*File
- func (app *App) GetUserData(id int64) *userData
- func (app *App) GetVersionString() string
- func (app *App) GoogleKey() string
- func (app *App) Handle(method, path string, action func(p *Request), constraints ...routerConstraint)
- func (app *App) HandleSimple(handler *SimpleHandler)
- func (app *App) Help(url string, name func(string) string, ...)
- func (app *App) Icon(icon string) *App
- func (app *App) IconURL() string
- func (app *App) InstallDatabase(rootPassword, codeName string) error
- func (app *App) ListenActivity(handler func(Activity))
- func (app *App) Log() *logger
- func (app *App) Logo(logo []byte) *App
- func (app *App) Mailing(locale string, fn func(*MailingData)) error
- func (app *App) Name(name func(string) string) *App
- func (app *App) NewForm(action string) *Form
- func (app *App) NewServer() server
- func (app *App) Notification(name string) *Notification
- func (app *App) Permission(permission Permission) *App
- func (app *App) RandomizationString() string
- func (app *App) Role(role string, permissions []Permission) *App
- func (app *App) Run()
- func (app *App) SetAfterRequestServedHandler(fn func(*Request))
- func (app *App) SetIcons(iconsFS embed.FS, prefix string)
- func (app *App) SetLogHandler(fn func(string, string))
- func (app *App) Setting(id string, permission Permission) *Setting
- func (app *App) Table() *Table
- func (app *App) TestUserData(role string) UserData
- func (app *App) UploadFile(fileHeader *multipart.FileHeader, request *Request, description string) (*File, error)
- func (app *App) UploadFileFromURL(ctx context.Context, fileURL string, userID int64, description string) (*File, error)
- type AppInfo
- type Board
- type Button
- type CustomSearchResult
- type DBConnectConfig
- type Dashboard
- func (dashboard *Dashboard) AddFormItemOptions(id, name string, options [][2]string)
- func (dashboard *Dashboard) Figure(name func(string) string, permission Permission) *dashboardFigure
- func (group *Dashboard) Table(tableFn func(*Request) *Table, permission Permission) *dashboardTable
- func (dashboard *Dashboard) Timeline(name func(string) string, permission Permission) *Timeline
- type DashboardFormItem
- type Email
- func (email *Email) Attachement(filename string, content []byte) *Email
- func (email *Email) From(name, emailAddress string) *Email
- func (email *Email) HTMLContent(content string) *Email
- func (email *Email) Send() error
- func (email *Email) Subject(subject string) *Email
- func (email *Email) TextContent(content string) *Email
- func (email *Email) To(name, emailAddress string) *Email
- type Field
- func (field *Field) DBDescription(description string) *Field
- func (field *Field) Description(description func(string) string) *Field
- func (field *Field) FixStringValue(fn func(string) string) *Field
- func (field *Field) FormContentGenerator(fn func(item *FormItem) template.HTML) *Field
- func (field *Field) FormFilter(filter *FormFilter) *Field
- func (field *Field) GetManuallySetPluralName(locale string) string
- func (field *Field) HelpURL(url string) *Field
- func (field *Field) IsSearchable(isSearchable bool) *Field
- func (field *Field) Name(name func(string) string) *Field
- func (field *Field) SuggestionURL(suggestionURL string) *Field
- func (field *Field) TextOver(textOver func(string) string) *Field
- func (field *Field) Validation(fn func(fieldVal any, userData UserData) error)
- func (field *Field) ViewContentGenerator(fn func(val any) template.HTML) *Field
- type FieldTypeEnum
- type File
- type Form
- func (f *Form) AddCAPTCHAInput(name, description string) *FormItem
- func (form *Form) AddCSRFToken(request *Request) *Form
- func (f *Form) AddCheckbox(name, description string) *FormItem
- func (f *Form) AddDatePicker(name, description string) *FormItem
- func (f *Form) AddDateTimePicker(name, description string) *FormItem
- func (f *Form) AddDeleteSubmit(description string) *FormItem
- func (f *Form) AddEmailInput(name, description string) *FormItem
- func (f *Form) AddFileInput(name, description string) *FormItem
- func (f *Form) AddHidden(name string) *FormItem
- func (f *Form) AddItem(item *FormItem)
- func (f *Form) AddNumberInput(name, description string) *FormItem
- func (f *Form) AddPasswordInput(name, description string) *FormItem
- func (f *Form) AddRadio(name, description string, values [][2]string) *FormItem
- func (f *Form) AddRelation(name, description string, relatedResourceID string) *FormItem
- func (f *Form) AddRelationMultiple(name, description string, relatedResourceID string) *FormItem
- func (f *Form) AddSelect(name, description string, values [][2]string) *FormItem
- func (f *Form) AddSubmit(description string) *FormItem
- func (f *Form) AddTextInput(name, description string) *FormItem
- func (f *Form) AddTextareaInput(name, description string) *FormItem
- func (f *Form) BindData(params url.Values)
- func (form *Form) GetBoxHeader() *boxHeader
- type FormFilter
- type FormItem
- type FormTaskActivity
- type FormTaskView
- type FormValidation
- type ImagePickerImage
- type ImagePickerResponse
- type MailingData
- type MailingDataSection
- type MailingRecipient
- type Notification
- func (n *Notification) Flash(request *Request) error
- func (n *Notification) Push(userID int64)
- func (n *Notification) SetDescription(description string) *Notification
- func (n *Notification) SetImage(image string) *Notification
- func (n *Notification) SetPreName(preName string) *Notification
- func (n *Notification) SetPrimaryAction(name string, fn func()) *Notification
- func (n *Notification) SetProgress(progress *float64) *Notification
- func (n *Notification) SetSecondaryAction(name string, fn func()) *Notification
- func (n *Notification) SetStyleFail() *Notification
- func (n *Notification) SetStyleSuccess() *Notification
- func (n *Notification) SetURL(url string) *Notification
- type PageDataSimple
- type Permission
- type PragoTemplates
- func (templates *PragoTemplates) Execute(wr io.Writer, name string, data interface{}) error
- func (templates *PragoTemplates) ExecuteToHTML(templateName string, data interface{}) template.HTML
- func (templates *PragoTemplates) ExecuteToString(templateName string, data interface{}) string
- func (templates *PragoTemplates) Function(name string, f interface{})
- func (templates *PragoTemplates) SetFilesystem(fsys fs.FS, patterns ...string) error
- type Preview
- type QueryData
- func (q *QueryData[T]) Aggregation() *Aggregation
- func (q *QueryData[T]) Context(ctx context.Context) *QueryData[T]
- func (q *QueryData[T]) Count() (int64, error)
- func (q *QueryData[T]) Debug() *QueryData[T]
- func (q *QueryData[T]) First() *T
- func (q *QueryData[T]) ID(id any) *T
- func (q *QueryData[T]) In(name string, value any) *QueryData[T]
- func (q *QueryData[T]) Is(name string, value interface{}) *QueryData[T]
- func (q *QueryData[T]) Limit(limit int64) *QueryData[T]
- func (q *QueryData[T]) List() []*T
- func (q *QueryData[T]) Offset(offset int64) *QueryData[T]
- func (q *QueryData[T]) Order(order string) *QueryData[T]
- func (q *QueryData[T]) OrderDesc(order string) *QueryData[T]
- func (q *QueryData[T]) Where(condition string, values ...interface{}) *QueryData[T]
- type Request
- func (request *Request) AddFlashMessage(message string)
- func (request *Request) Authorize(permission Permission) bool
- func (request *Request) Duration() time.Duration
- func (request *Request) Email() string
- func (request *Request) Locale() string
- func (request *Request) Name() string
- func (request Request) Param(name string) string
- func (request Request) Params() url.Values
- func (request *Request) Phone() string
- func (request *Request) Redirect(url string)
- func (request Request) Request() *http.Request
- func (request Request) Response() http.ResponseWriter
- func (request *Request) UserID() int64
- func (request *Request) WriteHTML(statusCode int, templates *PragoTemplates, templateName string, data any)
- func (request *Request) WriteJSON(statusCode int, data interface{})
- type Resource
- func (resource *Resource) Board(board *Board) *Resource
- func (resource *Resource) Dashboard(name func(string) string) *Dashboard
- func (resource *Resource) DefaultValue(fieldName string, fn func(*Request) string)
- func (resource *Resource) Field(name string) *Field
- func (resource *Resource) Icon(icon string) *Resource
- func (resource *Resource) ItemsPerPage(itemsPerPage int64) *Resource
- func (resource *Resource) Name(singularName, pluralName func(string) string) *Resource
- func (resource *Resource) PermissionCreate(permission Permission) *Resource
- func (resource *Resource) PermissionDelete(permission Permission) *Resource
- func (resource *Resource) PermissionExport(permission Permission) *Resource
- func (resource *Resource) PermissionUpdate(permission Permission) *Resource
- func (resource *Resource) PermissionView(permission Permission) *Resource
- type Setting
- type SimpleHandler
- type SimpleSection
- type Suggestion
- type Suggestions
- type SuggestionsButton
- type Table
- func (t *Table) AddFooterText(text string)
- func (table *Table) Cell(item any) *TableCell
- func (t *Table) ExecuteHTML() template.HTML
- func (t *Table) ExportXLSX(writer io.Writer) error
- func (table *Table) Header(items ...string) *Table
- func (table *Table) Javascript(javascript template.JS) *Table
- func (table *Table) Row(items ...*TableCell) *Table
- func (table *Table) Table() *Table
- type TableCell
- func (cell *TableCell) AsyncDataURL(url string) *TableCell
- func (cell *TableCell) Button(btn *TableCellButton) *TableCell
- func (cell *TableCell) CSSClass(class string) *TableCell
- func (cell *TableCell) Center() *TableCell
- func (cell *TableCell) Checkbox(name string, checked bool) *TableCell
- func (cell *TableCell) Colspan(i int64) *TableCell
- func (cell *TableCell) DescriptionAfter(description string) *TableCell
- func (cell *TableCell) DescriptionBefore(description string) *TableCell
- func (cell *TableCell) Files(app *App, fileIDs string) *TableCell
- func (cell *TableCell) Green() *TableCell
- func (cell *TableCell) Header() *TableCell
- func (cell *TableCell) Nowrap() *TableCell
- func (cell *TableCell) Orange() *TableCell
- func (cell *TableCell) Pre() *TableCell
- func (cell *TableCell) Progress(progress float64) *TableCell
- func (cell *TableCell) Red() *TableCell
- func (cell *TableCell) Right() *TableCell
- func (cell *TableCell) Rowspan(i int64) *TableCell
- func (cell *TableCell) Style(style template.CSS) *TableCell
- func (cell *TableCell) TextAfter(text string) *TableCell
- func (cell *TableCell) URL(link string) *TableCell
- type TableCellAsyncData
- type TableCellButton
- type TemporaryCacheData
- type Timeline
- type TimelineDataRequest
- type TimelineDataSource
- type UserData
- type Validation
- type ValidationError
- type Writer
- func (w *Writer[T]) After(fn func(*Request, *T)) *Writer[T]
- func (w *Writer[T]) Before(fn func(*Request, *T)) *Writer[T]
- func (w *Writer[T]) GET(path string, handler func(*Request, *T), constraints ...routerConstraint)
- func (w *Writer[T]) POST(path string, handler func(*Request, *T), constraints ...routerConstraint)
Constants ¶
This section is empty.
Variables ¶
var ErrItemNotFound = errors.New("item not found")
ErrItemNotFound is returned when no item is found
var ErrWrongWhereFormat = errors.New("wrong where format")
ErrWrongWhereFormat is returned when where query has a bad format
Functions ¶
func CreateItem ¶
func CreateItemWithContext ¶
func CreateWithLog ¶
func DeleteItemWithContext ¶
func DeleteWithLog ¶
func IsEmailValid ¶
func IsPhoneNumberValid ¶
func ItemStatistic ¶
func PreviewURLFunction ¶
func UpdateItem ¶
func UpdateItemWithContext ¶
func UpdateWithLog ¶
func ValidateDelete ¶
func ValidateDelete[T any](app *App, fn func(item *T, validation Validation, userData UserData))
func ValidateUpdate ¶
func ValidateUpdate[T any](app *App, fn func(item *T, validation Validation, userData UserData))
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) HandlerJSON ¶
TODO: Deprecated
func (*API) Permission ¶
func (api *API) Permission(permission Permission) *API
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action represents action
func ActionForm ¶
func ActionResourceForm ¶
func ActionResourceItemForm ¶
func ActionResourceItemPlain ¶
func ActionResourceItemUI ¶
func ActionResourcePlain ¶
func ActionResourceUI ¶
func (*Action) Permission ¶
func (action *Action) Permission(permission Permission) *Action
type Aggregation ¶
type Aggregation struct {
// contains filtered or unexported fields
}
func (*Aggregation) Count ¶
func (agg *Aggregation) Count() *Aggregation
func (*Aggregation) Get ¶
func (agg *Aggregation) Get() ([]int64, error)
func (*Aggregation) Max ¶
func (agg *Aggregation) Max(fieldName string) *Aggregation
func (*Aggregation) Min ¶
func (agg *Aggregation) Min(fieldName string) *Aggregation
func (*Aggregation) Sum ¶
func (agg *Aggregation) Sum(fieldName string) *Aggregation
type App ¶
type App struct {
UsersResource *Resource
FilesResource *Resource
MainBoard *Board
EmailSentHandler func(*Email)
InitializationAfterServerStart func()
// contains filtered or unexported fields
}
func (*App) AddCustomSearchFunction ¶
func (app *App) AddCustomSearchFunction(fn func(q string, userData UserData) []*CustomSearchResult)
func (*App) AddDevStaticFiles ¶
AddDevStaticFiles adds path for public files for development and publish them in server's root
func (*App) AddEnumFieldType ¶
func (*App) AddEnumFieldTypeLocalized ¶
func (app *App) AddEnumFieldTypeLocalized(name string, items []FieldTypeEnum)
func (*App) AddJavascript ¶
func (*App) AddLessDevelopmentPaths ¶
AddLessDevelopmentPaths compiles less files in sourcePath into targetPath in development mode
func (*App) AddManagerOfRole ¶
func (*App) AddPragoDevelopmentPath ¶
func (*App) AddSassDevelopmentPaths ¶
func (*App) AddServerSetup ¶
func (*App) AddStaticFiles ¶
AddStaticFiles add filesystem of public files and publish them in server's root
func (*App) AddTemplatesDevelopmentPath ¶
func (app *App) AddTemplatesDevelopmentPath(templates *PragoTemplates, watchPath string, matchPatterns ...string)
func (*App) AddTypeScriptDevelopmentPath ¶
AddTypeScriptDevelopmentPath automatically runs compilation of .tsc file in development mode
func (*App) AfterAction ¶
AddAfterAction adds action which is executed after main router action is called
func (*App) BeforeAction ¶
AddBeforeAction adds action which is executed before main router action is called
func (*App) ClearCache ¶
func (app *App) ClearCache()
func (*App) DevelopmentMode ¶
DevelopmentMode returns if app is running in development mode
func (*App) FormFilter ¶
func (app *App) FormFilter() *FormFilter
func (*App) GenerateCSRFToken ¶
func (*App) GetAdminTemplates ¶
func (app *App) GetAdminTemplates() *PragoTemplates
func (*App) GetAllUsers ¶
func (*App) GetAppInfo ¶
func (*App) GetCDNVideoURL ¶
func (*App) GetCachedUserEmail ¶
func (*App) GetUserData ¶
func (*App) GetVersionString ¶
func (*App) Handle ¶
func (app *App) Handle(method, path string, action func(p *Request), constraints ...routerConstraint)
Get creates new route for GET request
func (*App) HandleSimple ¶
func (app *App) HandleSimple(handler *SimpleHandler)
func (*App) InstallDatabase ¶
func (*App) ListenActivity ¶
ListenActivity listens to all changes in app's administration
func (*App) NewServer ¶
func (app *App) NewServer() server
TODO: remove after fixed tests in lazensky
func (*App) Notification ¶
func (app *App) Notification(name string) *Notification
Notification creates notification
func (*App) Permission ¶
func (app *App) Permission(permission Permission) *App
Permission adds permission to admin
func (*App) RandomizationString ¶
func (*App) Role ¶
func (app *App) Role(role string, permissions []Permission) *App
Role adds role to admin
func (*App) SetAfterRequestServedHandler ¶
func (*App) SetLogHandler ¶
func (*App) TestUserData ¶
func (*App) UploadFile ¶
type CustomSearchResult ¶
type DBConnectConfig ¶
type DBConnectConfig struct {
Name string `json:"name"`
User string `json:"user"`
Password string `json:"password"`
}
func GetDBConnectConfig ¶
func GetDBConnectConfig(codeName string) (*DBConnectConfig, error)
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
func (*Dashboard) AddFormItemOptions ¶
func (*Dashboard) Figure ¶
func (dashboard *Dashboard) Figure(name func(string) string, permission Permission) *dashboardFigure
type DashboardFormItem ¶
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
func (*Email) HTMLContent ¶
func (*Email) TextContent ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) DBDescription ¶
func (*Field) FormContentGenerator ¶
func (*Field) FormFilter ¶
func (field *Field) FormFilter(filter *FormFilter) *Field
func (*Field) GetManuallySetPluralName ¶
func (*Field) IsSearchable ¶
func (*Field) SuggestionURL ¶
func (*Field) Validation ¶
type FieldTypeEnum ¶
type File ¶
type File struct {
ID int64 `prago-order-desc:"true"`
UID string `prago-unique:"true" prago-type:"cdnfile"`
Name string `prago-can-edit:"nobody"`
Description string `prago-type:"text"`
User int64 `prago-type:"relation" prago-can-edit:"nobody"`
Width int64 `prago-can-edit:"nobody"`
Height int64 `prago-can-edit:"nobody"`
CreatedAt time.Time
UpdatedAt time.Time
}
File is structure representing files in admin
func (*File) GetExactSize ¶
func (*File) GetOriginal ¶
type Form ¶
type Form struct {
Action string
Icon string
Title string
Description string
Items []*FormItem
Valid bool
CSRFToken string
HTMLAfter template.HTML
AutosubmitFirstTime bool
AutosubmitOnDataChange bool
ScriptPaths []string
// contains filtered or unexported fields
}
Form represents admin form
func (*Form) AddCAPTCHAInput ¶
AddCAPTCHAInput to form
func (*Form) AddCSRFToken ¶
func (*Form) AddCheckbox ¶
AddCheckbox to form
func (*Form) AddDatePicker ¶
AddDatePicker to form
func (*Form) AddDateTimePicker ¶
func (*Form) AddDeleteSubmit ¶
AddDeleteSubmit to form
func (*Form) AddEmailInput ¶
AddEmailInput to form
func (*Form) AddFileInput ¶
AddFileInput to form
func (*Form) AddNumberInput ¶
func (*Form) AddPasswordInput ¶
AddPasswordInput to form
func (*Form) AddRelation ¶
func (*Form) AddRelationMultiple ¶
func (*Form) AddTextInput ¶
AddTextInput to form
func (*Form) AddTextareaInput ¶
AddTextareaInput to form
func (*Form) GetBoxHeader ¶
func (form *Form) GetBoxHeader() *boxHeader
type FormFilter ¶
type FormFilter struct {
// contains filtered or unexported fields
}
func (*FormFilter) Is ¶
func (filter *FormFilter) Is(name string, value interface{}) *FormFilter
func (*FormFilter) Where ¶
func (filter *FormFilter) Where(condition string, values ...interface{}) *FormFilter
type FormItem ¶
type FormItem struct {
ID string
Icon string
Name string
Description string
DescriptionsBefore []string
DescriptionsAfter []string
Placeholder string
Required bool
Focused bool
Readonly bool
HiddenName bool
Hidden bool
Template string
Value string
Data interface{}
Content template.HTML
TextOver string
UUID string
Autocomplete string
InputMode string
HelpURL string
FileMultiple bool
FileAccept string
FormFilterID string
SuggestionURL string
// contains filtered or unexported fields
}
FormItem represents item of form
func (*FormItem) AddFromFilter ¶
func (f *FormItem) AddFromFilter(formFilter *FormFilter)
func (*FormItem) GetContent ¶
type FormTaskActivity ¶
type FormTaskActivity struct {
// contains filtered or unexported fields
}
func (*FormTaskActivity) Description ¶
func (fta *FormTaskActivity) Description(description string)
func (*FormTaskActivity) Progress ¶
func (fta *FormTaskActivity) Progress(finishedSoFar, total int64)
func (*FormTaskActivity) TableCells ¶
func (fta *FormTaskActivity) TableCells(cells ...*TableCell)
type FormTaskView ¶
type FormValidation ¶
type ImagePickerImage ¶
type ImagePickerResponse ¶
type ImagePickerResponse struct {
Items []*ImagePickerImage
}
type MailingData ¶
type MailingData struct {
App *App
BaseURL string
LogoURL string
AppName string
FromEmail string
FromName string
Tos []*MailingRecipient
Subject string
PreName string
Name string
PostName string
Images []*File
Description template.HTML
Text template.HTML
Sections []*MailingDataSection
Button *Button
}
func (*MailingData) AddRecipient ¶
func (md *MailingData) AddRecipient(name, email string) *MailingData
func (*MailingData) AddSection ¶
func (md *MailingData) AddSection(name, text string) *MailingDataSection
type MailingDataSection ¶
type MailingRecipient ¶
type Notification ¶
type Notification struct {
// contains filtered or unexported fields
}
NotificationItem represents item for notification
func (*Notification) Flash ¶
func (n *Notification) Flash(request *Request) error
func (*Notification) Push ¶
func (n *Notification) Push(userID int64)
func (*Notification) SetDescription ¶
func (n *Notification) SetDescription(description string) *Notification
SetDescription sets description to notification item
func (*Notification) SetImage ¶
func (n *Notification) SetImage(image string) *Notification
func (*Notification) SetPreName ¶
func (n *Notification) SetPreName(preName string) *Notification
SetPreName sets prefix name to notification item
func (*Notification) SetPrimaryAction ¶
func (n *Notification) SetPrimaryAction(name string, fn func()) *Notification
func (*Notification) SetProgress ¶
func (n *Notification) SetProgress(progress *float64) *Notification
SetProgress sets description to notification item
func (*Notification) SetSecondaryAction ¶
func (n *Notification) SetSecondaryAction(name string, fn func()) *Notification
func (*Notification) SetStyleFail ¶
func (n *Notification) SetStyleFail() *Notification
SetTypeFail sets notification item type to fail
func (*Notification) SetStyleSuccess ¶
func (n *Notification) SetStyleSuccess() *Notification
SetTypeSuccess sets notification item type to success
func (*Notification) SetURL ¶
func (n *Notification) SetURL(url string) *Notification
type PageDataSimple ¶
type PragoTemplates ¶
type PragoTemplates struct {
// contains filtered or unexported fields
}
func NewPragoTemplates ¶
func NewPragoTemplates() *PragoTemplates
func (*PragoTemplates) Execute ¶
func (templates *PragoTemplates) Execute(wr io.Writer, name string, data interface{}) error
func (*PragoTemplates) ExecuteToHTML ¶
func (templates *PragoTemplates) ExecuteToHTML(templateName string, data interface{}) template.HTML
func (*PragoTemplates) ExecuteToString ¶
func (templates *PragoTemplates) ExecuteToString(templateName string, data interface{}) string
func (*PragoTemplates) Function ¶
func (templates *PragoTemplates) Function(name string, f interface{})
func (*PragoTemplates) SetFilesystem ¶
func (templates *PragoTemplates) SetFilesystem(fsys fs.FS, patterns ...string) error
type QueryData ¶
type QueryData[T any] struct { // contains filtered or unexported fields }
func (*QueryData[T]) Aggregation ¶
func (q *QueryData[T]) Aggregation() *Aggregation
type Request ¶
type Request struct {
Written bool
ResponseStatus int
//ResponseTemplates *PragoTemplates
ResponseTemplateName string
// contains filtered or unexported fields
}
Request represents structure for http request
func (*Request) AddFlashMessage ¶
AddFlashMessage adds flash message to request
func (*Request) Authorize ¶
func (request *Request) Authorize(permission Permission) bool
func (Request) Response ¶
func (request Request) Response() http.ResponseWriter
Response returns underlying http.ResponseWriter
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func NewResource ¶
func (*Resource) DefaultValue ¶
func (*Resource) ItemsPerPage ¶
func (*Resource) PermissionCreate ¶
func (resource *Resource) PermissionCreate(permission Permission) *Resource
func (*Resource) PermissionDelete ¶
func (resource *Resource) PermissionDelete(permission Permission) *Resource
func (*Resource) PermissionExport ¶
func (resource *Resource) PermissionExport(permission Permission) *Resource
func (*Resource) PermissionUpdate ¶
func (resource *Resource) PermissionUpdate(permission Permission) *Resource
func (*Resource) PermissionView ¶
func (resource *Resource) PermissionView(permission Permission) *Resource
type Setting ¶
type Setting struct {
// contains filtered or unexported fields
}
func (*Setting) DefaultValue ¶
func (*Setting) ValueChangeCallback ¶
type SimpleHandler ¶
type SimpleHandler struct {
URL string
Handler func(*PageDataSimple)
FormValidation func(FormValidation, *Request)
}
type SimpleSection ¶
type Suggestion ¶
type Suggestions ¶
type Suggestions struct {
Message string
Suggestions []*Suggestion
Button *SuggestionsButton
}
type SuggestionsButton ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) AddFooterText ¶
func (*Table) ExecuteHTML ¶
TODO execute right into response
type TableCell ¶
type TableCell struct {
// contains filtered or unexported fields
}
func (*TableCell) AsyncDataURL ¶
func (*TableCell) Button ¶
func (cell *TableCell) Button(btn *TableCellButton) *TableCell
func (*TableCell) DescriptionAfter ¶
func (*TableCell) DescriptionBefore ¶
type TableCellAsyncData ¶
type TableCellButton ¶
func (TableCellButton) GetTitle ¶
func (btn TableCellButton) GetTitle() string
type TemporaryCacheData ¶
type TemporaryCacheData[T any] struct { // contains filtered or unexported fields }
func TemporaryCache ¶
func TemporaryCache[T any](app *App) *TemporaryCacheData[T]
func (TemporaryCacheData[T]) GetItemByID ¶
func (tc TemporaryCacheData[T]) GetItemByID(id int64) *T
type Timeline ¶
type Timeline struct {
// contains filtered or unexported fields
}
func (*Timeline) DataSource ¶
func (timeline *Timeline) DataSource(dataSource func(request *TimelineDataRequest) float64) *TimelineDataSource
type TimelineDataRequest ¶
type TimelineDataSource ¶
type TimelineDataSource struct {
// contains filtered or unexported fields
}
func (*TimelineDataSource) Name ¶
func (tds *TimelineDataSource) Name(name func(string) string) *TimelineDataSource
func (*TimelineDataSource) Stringer ¶
func (tds *TimelineDataSource) Stringer(stringer func(float64) string) *TimelineDataSource
type Validation ¶
type ValidationError ¶
func TestValidationDelete ¶
func TestValidationDelete[T any](app *App, item *T, user UserData) ([]ValidationError, bool)
func TestValidationUpdate ¶
func TestValidationUpdate[T any](app *App, item *T, user UserData) ([]ValidationError, bool)
Source Files
¶
- access.go
- accordion.go
- action.go
- activitylog.go
- admin.go
- admin_api.go
- aggregations.go
- ai.go
- api.go
- app.go
- backup.go
- board.go
- board_view.go
- box.go
- breadcrumbs.go
- build.go
- cache.go
- cache_access.go
- cache_reloader.go
- cache_stats.go
- cdn.go
- command.go
- controller.go
- cron.go
- dashboard.go
- dashboard_figure.go
- dashboard_form.go
- dashboard_table.go
- db.go
- db_connect.go
- development.go
- email.go
- email_sent.go
- exit.go
- field.go
- field_validation.go
- fieldtype.go
- fieldtypeenum.go
- file.go
- file_upload.go
- form.go
- form_action.go
- form_filter.go
- form_task.go
- form_task_view.go
- help.go
- icons.go
- imagepicker.go
- info.go
- install.go
- list.go
- list_cell.go
- list_content.go
- list_query.go
- list_settings.go
- list_stats.go
- locale.go
- logger.go
- mailing.go
- markdown.go
- menu.go
- messages.go
- migration.go
- multiple_item_action.go
- mysql.go
- navigation.go
- notifications.go
- page_data.go
- pprof.go
- query.go
- recovery.go
- relation.go
- request.go
- resource.go
- resource_actions.go
- resource_actions_multiple.go
- resource_api.go
- resource_edit.go
- resource_export_csv.go
- resource_item_action.go
- resource_item_stats.go
- resource_preview.go
- router.go
- search.go
- server.go
- sessions.go
- settings.go
- simple.go
- simple_handle.go
- sqlbackup.go
- sqlconsole.go
- sqlview.go
- static.go
- struct.go
- struct_bind.go
- struct_scanners.go
- suggestions.go
- synced_item.go
- systemstats.go
- table.go
- templates.go
- temporary_cache.go
- timeline.go
- timeline_datasource.go
- timeline_legend.go
- user.go
- user_csrf.go
- user_data.go
- user_login.go
- user_registration.go
- user_renew.go
- user_settings.go
- utils.go
- validation.go
- validation_form.go
- validation_item.go
- view.go
- view_relations.go
- watcher.go
- writer.go