flint

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 25 Imported by: 0

README

Flint Logo

Flint

A blazing fast and lightweight web framework for Go.

Docs

Telegram Channel

Telegram Turkey Channel

X

YouTube


⚡️ What is Flint?

Flint is a simple and minimal backend framework written in Go, made for fast API development with clean structure and easy usage.

🐾 Flinex

Flint Mascot

🚀 Quick Start

go get github.com/coderianx/flint
package main

import "github.com/coderianx/flint"

func main() {
    app := flint.NewServer()

    app.Handle("/", func(ctx flint.Context) {
        ctx.String("Hello from Flint!")
    })

    app.Run(":8080")
}

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ using Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argon2Hash

func Argon2Hash(password string) (string, error)

func Argon2Verify

func Argon2Verify(password, encodedHash string) (bool, error)

func Bcrypt

func Bcrypt(password string, optionalCost ...int) string

func Blake2b

func Blake2b(data string) string

func Blake2s

func Blake2s(data string) string

func CompareBcrypt

func CompareBcrypt(password, hashed string) bool

func CreateLogFile

func CreateLogFile(fileName string) error

func FakeData

func FakeData(filename string, count int)

func Info

func Info()

func LogError

func LogError(function string, message string)

func Md5

func Md5(args ...string) string

func Sha256

func Sha256(args ...string) string

func Sha3_256

func Sha3_256(args ...string) string

func Sha3_512

func Sha3_512(args ...string) string

func Sha512

func Sha512(args ...string) string

func Version

func Version()

Types

type Context

type Context struct {
	Writer  http.ResponseWriter
	Request *http.Request
}

func (*Context) Default404

func (c *Context) Default404()

func (*Context) Default405 added in v1.2.0

func (c *Context) Default405()

func (*Context) Delete

func (c *Context) Delete() bool

func (*Context) File

func (c *Context) File(filepath string)

func (*Context) FormArgon2 added in v1.2.0

func (c *Context) FormArgon2(key string) string

func (*Context) FormBcrypt

func (c *Context) FormBcrypt(key string) string

func (*Context) FormData

func (c *Context) FormData(key string) string

func (*Context) FormFile

func (c *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error)

func (*Context) FormInt

func (c *Context) FormInt(key string) int

func (*Context) FormMD5

func (c *Context) FormMD5(key string) string

func (*Context) FormSHA256

func (c *Context) FormSHA256(key string) string

func (*Context) FormSHA512

func (c *Context) FormSHA512(key string) string

func (*Context) Get

func (c *Context) Get() bool

func (*Context) HTML

func (c *Context) HTML(status int, tmplPath string, data interface{})

func (*Context) JSON

func (c *Context) JSON(status int, data interface{})

func (*Context) Post

func (c *Context) Post() bool

func (*Context) Put added in v1.2.0

func (c *Context) Put() bool

func (*Context) Query added in v1.1.0

func (c *Context) Query(key string) string

func (*Context) QueryFloat added in v1.1.0

func (c *Context) QueryFloat(key string, defaultVal float64) float64

func (*Context) QueryInt added in v1.1.0

func (c *Context) QueryInt(key string) (int, error)

func (*Context) QueryIntDefault added in v1.1.0

func (c *Context) QueryIntDefault(key string, defaulVal int) int

func (*Context) Redirect

func (c *Context) Redirect(status int, url string)

func (*Context) String

func (c *Context) String(status int, text string)

func (*Context) Stringf added in v1.1.0

func (c *Context) Stringf(status int, text string, a ...any)

func (*Context) Template404

func (c *Context) Template404(templatePath string, data ...any)

func (*Context) Template405 added in v1.2.0

func (c *Context) Template405(templatePath string, data ...any)

func (*Context) UserAgent added in v1.2.0

func (c *Context) UserAgent() string

type FakeUser

type FakeUser struct {
	ID        int    `json:"id"`
	Username  string `json:"username"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	HashedPwd string `json:"hashed_password"`
}

type HandlerFunc

type HandlerFunc func(ctx *Context)

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Handle

func (r *Router) Handle(path string, handler HandlerFunc)

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Server

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

func NewServer

func NewServer() *Server

A new Flint Server is created.

func (*Server) Handle

func (s *Server) Handle(path string, handler HandlerFunc)

func (*Server) Run

func (s *Server) Run(addr ...string) error

func (*Server) SetNotFound

func (s *Server) SetNotFound(handler HandlerFunc)

func (*Server) Static

func (s *Server) Static(routePath, dir string)

Directories

Path Synopsis
examples
basic command
basic/useragent command
register_app command
search command
simple_restapi command
test
run_test command

Jump to

Keyboard shortcuts

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