asdgo

package module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 18 Imported by: 0

README

asdgo

[!CAUTION] This repository is heavily under development and is not ready for production use. It's untested, it uses global vars, it's not documented and I'm new Go. I'm currently using it to build my projects and sometimes I decide to rewrite stuff, thus breaking things. I use it for almost all my personal Go web projects. I will update/remove this message when it's ready for public use and is going into a stable release.

Asdgo is an opinionated and simple Go web "framework", or rather a set of components which glues together some packages and logic that I don't want to write everytime I start a new project.

This project uses the following amazing packages (please go check them out)

Components

Every component is prefixed with the letter a, so it doesn't conflict with the naming of other packages (or internal packages). So template becomes atemplate, mail becomes amail, etc, etc.

acontext

(For retrieving things from the context)

adatabase

(For default user model)

ahash

(For hash)

amail

(For sending emails)

amiddleware
aqueue

(A simple queue)

aschedule

(A simple schedule)

asession
atemplate
avalidate

Example

asd := asdgo.New(asdgo.Config{})

asd.GET("/", func (c echo.Context) error {
    return c.SendString(http.StatusOK, "Hello, world!")
})

Feedback

If you have any ideas on how to improve things, please open a issue or pull request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Db added in v0.4.0

func Db() *adatabase.Database

func Env added in v0.4.0

func Env()

func Hash added in v0.4.0

func Hash() *ahash.Hash

func Mailer added in v0.2.0

func Mailer() *amail.Mailer

func Session added in v0.0.7

func Session() *asession.Session

func Validator added in v0.0.7

func Validator() *avalidate.Validator

Types

type Asdgo

type Asdgo struct {
	*echo.Echo
}

func New

func New(config *Config) *Asdgo

type Config added in v0.3.0

type Config struct {
	Database *gorm.DB

	SessionName string

	CsrfName    string
	CsrfSkipper func(c echo.Context) bool

	TemplateNotFound templ.Component
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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