goe

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

GOE

GOE is a simple and easy to use web development framework for Go. It is designed to be simple and easy to use, and to be able to quickly build a web application. It is based on the GoFiber v3 framework, and adds some useful features.

GOE learned from practices of Golang projects, Java web development frameworks, such as Spring Boot, and tried to provide a similar experience but simpler and lighter.

Thanks for the following projects that GOE relies on or inspired by:

  • GoFiber - For handling HTTP related tasks.
  • GoFr - For the project structure and interface design.
  • Qmgo - For the MongoDB operations.
  • Gookit Validate - For the data validation.
  • PocketBase - For the mailer implementation and interface design.
  • Delayqueue - For the message queue implementation.
  • Zap - For the logger implementation.
  • Kelindar Event - For the event bus implementation.

Goals

The only goal of GOE is to provide a simple and easy to use web development framework for Go. Developers should only focus on the business logic, and GOE will handle the rest.

Supported Database

Currently, GOE only supports MongoDB.

Quick Start

go get -u go.oease.dev/goe
package main

import (
	"github.com/gofiber/fiber/v3"
	"go.oease.dev/goe"
)

func main() {
	// This is an example of a main function
	// Create a new goe app, this will initialize the app and its dependencies
	err := goe.NewApp()
	if err != nil {
		panic(err)
		return
	}

	// Use the Fiber module to set up a simple hello world route
	goe.UseFiber().App().Get("/hello", func(ctx fiber.Ctx) error {
		return ctx.SendString("Hello, World!")
	})

	// Run the app, this will start the server and block the main thread. Graceful shutdown is supported.
	err = goe.Run()
	if err != nil {
		panic(err)
		return
	}
}

read more in example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddShutdownHook

func AddShutdownHook(hookHandlers ...func() error) error

func NewApp

func NewApp() error

func Run

func Run() error

func UseCache

func UseCache() contracts.Cache

func UseCfg

func UseCfg() contracts.Config

func UseCron

func UseCron() contracts.CronJob

func UseDB

func UseDB() contracts.MongoDB

func UseFiber

func UseFiber() contracts.GoeFiber

func UseLog

func UseLog() contracts.Logger

func UseMQ

func UseMQ() contracts.Queue

func UseMailer

func UseMailer() contracts.Mailer

func UseSearch

func UseSearch() contracts.Meilisearch

Types

type App

type App struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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