Core MVC golang framework
Find a file
2026-09-13 01:18:05 -05:00
env initial commits 2 2024-09-12 17:13:16 -05:00
logger Added Level type - A custom int type with constants DEBUG, INFO, WARNING, ERROR in increasing severity order. 2026-05-06 16:06:25 -05:00
scheduler scheduler updates 2026-06-23 18:12:36 -05:00
template/components add id 2025-08-26 13:31:13 -05:00
testingdata Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
.gitignore add documentation 2025-02-24 09:59:07 -05:00
cache.go add documentation 2025-02-24 09:59:07 -05:00
cache_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
config.go Create a scheduler as a first-class core module feature, following the same pattern used for the Asynq queue system. The new core/scheduler/ subpackage contains QueueItem and ProcessedItem GORM models (tables queue_items and processed_items), a Store for database operations (enqueue, claim batch with SELECT FOR UPDATE SKIP LOCKED, result recording, stuck recovery), a Semaphore kill switch, and the polling Scheduler loop with configurable interval and rate limit. The core/scheduler.go wrapper exposes a Schedulermux struct (analogous to Queuemux) with SchedulerInit(), AddWork(), SetStore(), and RunScheduler() methods, plus global accessors ResolveSchedulerStore() and SchedulerSemaphoreSetGreen/Red/IsGreen() so controllers can enqueue work and control the semaphore without importing the subpackage directly. 2026-06-13 18:19:01 -05:00
consts.go add core services, add graph service, add component graph 2024-10-28 11:33:06 -05:00
context.go migrated from cup session to core/session.go, Contains the new SessionUser struct and the CreateAuthTokenHashedCacheKey utility function 2026-05-18 13:02:06 -05:00
context_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
controller.go change hooks 2024-09-16 16:01:44 -05:00
cookies.go function for clear cookie in the user 2026-09-12 22:16:36 -05:00
cookies_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
core.go migrated from cup session to core/session.go, Contains the new SessionUser struct and the CreateAuthTokenHashedCacheKey utility function 2026-05-18 13:02:06 -05:00
core_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
event-job.go initial commits 2 2024-09-12 17:13:16 -05:00
event.go initial commits 2 2024-09-12 17:13:16 -05:00
events-manager.go initial commits 2 2024-09-12 17:13:16 -05:00
events-manager_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
go.mod - Refactory cookie and API session handle. Insolated y routes and controllers (api-auth.go, app-auth.go). 2026-09-12 21:26:31 -05:00
go.sum - Refactory cookie and API session handle. Insolated y routes and controllers (api-auth.go, app-auth.go). 2026-09-12 21:26:31 -05:00
graph.go sync graph code 2026-05-02 00:37:10 -05:00
hashing.go initial commits 2 2024-09-12 17:13:16 -05:00
hashing_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
hook.go migration 2024-09-15 19:19:54 -05:00
hooks.go change hooks 2024-09-16 16:01:44 -05:00
hooks_test.go change hooks 2024-09-16 16:01:44 -05:00
jwt.go - Refactory cookie and API session handle. Insolated y routes and controllers (api-auth.go, app-auth.go). 2026-09-12 21:26:31 -05:00
jwt_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
LICENSE initial commits 2 2024-09-12 17:13:16 -05:00
mailer.go initial commits 2 2024-09-12 17:13:16 -05:00
queue.go get queue configurations from config in cup 2026-05-18 22:34:37 -05:00
README.md updated README.md 2026-09-13 01:18:05 -05:00
request.go initial commits 2 2024-09-12 17:13:16 -05:00
response.go fix typo 2026-05-13 00:14:02 -05:00
response_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
router.go add documentation 2025-02-24 09:59:07 -05:00
router_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
scheduler.go scheduler updates 2026-06-23 18:12:36 -05:00
session.go - Refactory cookie and API session handle. Insolated y routes and controllers (api-auth.go, app-auth.go). 2026-09-12 21:26:31 -05:00
session_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
templates.go - Add function RenderNamedTemplate executes a named template from the registered set with the given data and returns the rendered HTML. 2026-05-11 20:17:30 -05:00
templates_test.go Upgrade and add new testing functions 2026-09-13 00:09:50 -05:00
testing-config.go initial commits 2 2024-09-12 17:13:16 -05:00
validator.go get body request, validator fix 2024-09-28 17:40:42 -05:00
validator_test.go initial commits 2 2024-09-12 17:13:16 -05:00

Goffee Core

The core library of the Goffee framework. It provides the building blocks used by every Goffee application: routing, the request Context and Response, hooks, events, JWT, sessions/cookies, cache, mailer, validation, templating, queues and the DB-backed scheduler.

If you are going to develop an application, the way to do so is through the Cup project. Check out the Goffee Cup repository.

Main concepts

App

core.App is the application container. core.New() creates it, Bootstrap() initializes the logger, router and events manager, and Run() starts the HTTP server. Configuration is applied through the Set...Config methods (SetRequestConfig, SetGormConfig, SetCacheConfig, SetEnvFileConfig, ...).

Router and controllers

Routes are registered on the singleton returned by core.ResolveRouter(). Each route maps a method + path to a Controller (a func(*core.Context) *core.Response) and an optional list of Hooks.

router := core.ResolveRouter()
router.Get("/users/:id", showUser, hooks.AuthCheck)

Context and Response

A *core.Context carries the request and exposes helpers: GetRequestParam, GetPathParam, GetHeader, GetRequesBodyStruct, GetUploadedFile, MoveFile, CopyFile, MapToJson, CastToString/CastToInt/CastToFloat, GetBaseDirPath, and service accessors like GetLogger, GetGorm, GetCache, GetJWT, GetMailer, GetSession, GetQueueClient and GetEventsManager. c.Response builds the reply with Json, Text, HTML, Template, BufferFile, Redirect, etc.

Packages

Package Description
core The framework itself: app, router, context, response, hooks, events, jwt, session, cache, mailer, validator, templates, queues and scheduler wiring.
core/env Helpers to read environment variables with defaults.
core/logger Logging drivers (LogFileDriver, LogNullDriver, ...).
core/scheduler The DB-backed task scheduler: Store, QueueItem, ProcessedItem, SchedulerMeta.
core/template/components Reusable template components (e.g. PageCard).

Background processing

  • Queues (asynq): see core.Queuemux / QueueConfig.
  • Scheduler: a lightweight DB-backed runner with priorities, concurrent threads and a global semaphore kill-switch. Use core.Schedulermux to register task handlers, then scheduler.NewStore(core.ResolveGorm()) and SetStore before RunScheduler.

License

MIT-style license. See the LICENSE file for details.