Documentation
¶
Index ¶
- func RunBranchTargetSeriesScheduler(ctx context.Context, store db.Store, hub *branchHub)
- type Attributes
- type CloseShiftRequest
- type Server
- func (server *Server) BranchHub() *branchHub
- func (server *Server) CloseShift(ctx *gin.Context)
- func (server *Server) RunClientSpendRefresh(ctx context.Context)
- func (server *Server) RunEmailScheduler(ctx context.Context)
- func (server *Server) RunGooglePlacesScheduler(ctx context.Context)
- func (server *Server) RunSecurity(ctx context.Context)
- func (server *Server) RunUnknownImageCleanup(ctx context.Context)
- func (server *Server) Start(address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBranchTargetSeriesScheduler ¶
RunBranchTargetSeriesScheduler ensures every active recurring target series has a branch_targets row for its current period, immediately on startup (so a period that started while the server was down still gets created promptly) and then on a fixed tick, for the life of the process. hub is used to push a live "go re-fetch targets" notification to the owning branch the moment a period fires, same as branch API handlers do on write -- see Server.BranchHub.
Types ¶
type Attributes ¶
type CloseShiftRequest ¶
type CloseShiftRequest struct {
ID int64 `uri:"id" binding:"required,min=1"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) BranchHub ¶
func (server *Server) BranchHub() *branchHub
BranchHub exposes the server's live-push hub so background schedulers (e.g. RunBranchTargetSeriesScheduler) that run outside a request's lifecycle can notify connected branches too, using the same connections branch API handlers push through.
func (*Server) CloseShift ¶
func (*Server) RunClientSpendRefresh ¶ added in v1.1.6
RunClientSpendRefresh (also tops up clients' phone flags) rebuilds the client_spend cache at start-up and then every few minutes. The clients and loyalty pages read it instead of summing every invoice per request, so a new sale shows up in the rankings within one interval.
func (*Server) RunEmailScheduler ¶ added in v1.1.0
RunEmailScheduler sends due scheduled reports, on startup (catching up on one missed while kashi was down, once) and then every emailScheduleCheckInterval, for the life of the process.
func (*Server) RunGooglePlacesScheduler ¶ added in v1.1.0
RunGooglePlacesScheduler checks the places shortly after start, then every googlePlacesEvery.
func (*Server) RunSecurity ¶ added in v1.1.0
RunSecurity keeps the request guard's settings, bans and visitor counts in step with the database and the IP-location databases current, until ctx ends (security.go). main starts it; tests don't.
func (*Server) RunUnknownImageCleanup ¶ added in v1.1.1
RunUnknownImageCleanup deletes old unknown-item pictures once a day, when the app setting unknown_images_auto_delete is on (off by default).
Source Files
¶
- access.go
- admin_activity.go
- admin_ws.go
- app_settings.go
- app_update.go
- asset.go
- attribute.go
- audit_log.go
- barcode.go
- barcode_design.go
- barcode_label.go
- barcode_pdf.go
- batch.go
- branch.go
- branch_attendance.go
- branch_cancel.go
- branch_catchup.go
- branch_client.go
- branch_client_batch.go
- branch_command.go
- branch_day_summary.go
- branch_discount.go
- branch_expense.go
- branch_expense_from_central.go
- branch_expense_image.go
- branch_history_sync.go
- branch_invoice.go
- branch_invoice_settlement.go
- branch_loan.go
- branch_payment_methods.go
- branch_photos.go
- branch_quick_access.go
- branch_record_category.go
- branch_register.go
- branch_settings.go
- branch_shift.go
- branch_shift_receipt_image.go
- branch_sync.go
- branch_sync_conflict.go
- branch_sync_coupons.go
- branch_sync_ids.go
- branch_sync_lists.go
- branch_sync_stock.go
- branch_sync_transfers.go
- branch_target.go
- branch_target_series.go
- branch_target_series_scheduler.go
- branch_transfer.go
- branch_user.go
- branch_visitor.go
- branch_ws.go
- bulk_delete.go
- business_zone.go
- busy_hours.go
- calendar_event.go
- cashbox.go
- cashbox_account.go
- cashbox_shift.go
- client.go
- client_phone_cleanup.go
- client_profile.go
- client_spend_refresh.go
- color.go
- coupon.go
- coupon_category.go
- coupon_list.go
- coupon_type.go
- currency.go
- dashboard.go
- deals.go
- default_branch_settings.go
- discountList.go
- discount_rules.go
- email_report.go
- email_report_xlsx.go
- email_schedule.go
- employee.go
- entry.go
- envelope.go
- expense.go
- expense_category.go
- expense_upload.go
- financials.go
- forecast.go
- geoip.go
- google_places.go
- home_activity_detail.go
- home_latest.go
- image_optimize.go
- image_thumbnail.go
- inventory.go
- invoice_details.go
- invoice_discounts.go
- invoice_type.go
- lebanese_phone.go
- loan.go
- loan_category.go
- loan_payment.go
- loan_upload.go
- log.go
- low_stock.go
- middleware.go
- pagination.go
- phone_upload_page.go
- photo_replace.go
- photo_rotation.go
- pos_settings.go
- priceList.go
- product.go
- product_barcode_lookup.go
- product_category.go
- product_cost_import.go
- product_create_missing.go
- product_import.go
- product_revenue.go
- purchase.go
- recurring_expense.go
- return_invoice.go
- review_link.go
- review_stats.go
- role.go
- sale_options.go
- sales_analysis.go
- sales_dashboard.go
- sales_invoice.go
- salesperson.go
- salesperson_performance.go
- security.go
- server.go
- shift_upload.go
- size.go
- stock_count.go
- stock_health.go
- supplier.go
- sync_notify.go
- transfer.go
- transfer_upload.go
- unknown_image_cleanup.go
- unknown_items.go
- user.go
- whatsapp.go
- whatsapp_bridge.go
- whatsapp_chat.go
- whatsapp_conversation.go
- whatsapp_health.go
- whatsapp_poll.go
- whatsapp_rules.go
- whatsapp_webhook.go
- ws_conn.go