ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - gopulse/pulse: Pulse: A Golang framework for web development
Pulse: A Golang framework for web development. Contribute to gopulse/pulse development by creating an account on GitHub.
Visit Site

GitHub - gopulse/pulse: Pulse: A Golang framework for web development

GitHub - gopulse/pulse: Pulse: A Golang framework for web development

Go Report Card GitHub license Go Reference Go Doc Discord Online codecov CircleCI

A Golang framework for web development that keeps your web applications and services responsive with its fast and lightweight design.

Features

  • Routing
  • Route groups
  • Static files
  • Simple and elegant API
  • Middleware support

Installation

Make sure you have Go installed on your machine. Then run the following command:

Initialize your project (Learn). Then install Pulse with the go get command:

go get github.com/gopulse/pulse

Benchmarks :zap:

This test was performed by Go Web.

Getting Started

package main

import (
	"github.com/gopulse/pulse"
)

func main() {
	app := pulse.New()
	router := pulse.NewRouter()

	app.Router = router

	router.Get("/", func(c *pulse.Context) error {
		c.String("Hello, World!")
		return nil
	})

	app.Run(":3000")
}

Examples

  • Routing

Supports GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD, CONNECT, TRACE

package main

import (
	"github.com/gopulse/pulse"
)

func main() {
    app := pulse.New()
    router := pulse.NewRouter()
    
    // GET /hello
    router.Get("/", func(c *pulse.Context) error {
        c.String("Hello, World!")
        return nil
    })
    
    // GET /hello/:name
    router.Get("/profile/:id", func(c *pulse.Context) error {
        c.String("Profile: " + c.Param("id"))
        return nil
    })
    
	// GET /user/
    router.Get("/user/*", func(c *pulse.Context) error {
        c.String("Hello, World!")
        return nil
    })
    
    app.Router = router
    
    app.Run(":3000")
}
  • Route groups

Supports GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD, CONNECT, TRACE

package main

import (
	"github.com/gopulse/pulse"
)

func main() {
	app := pulse.New()
	router := pulse.NewRouter()
	api := &pulse.Group{
		prefix: "/api",
		router: router,
	}

	v1 := api.Group("/v1")
	v1.GET("/users", func(ctx *Context) error {
		ctx.String("users")
		return nil
	})

	app.Router = router

	app.Run(":3000")
}
  • Static files
package main

import (
	"github.com/gopulse/pulse"
	"time"
)

func main() {
	app := pulse.New()
	router := pulse.NewRouter()

	// Static files (./static) with cache duration 24 hours
	router.Static("/", "./static", &pulse.Static{
		Compress:      true,
		ByteRange:     false,
		IndexName:     "index.html",
		CacheDuration: 24 * time.Hour,
	})

	app.Router = router

	app.Run(":3000")
}
  • Middleware
package main

import (
	"github.com/gopulse/pulse"
)

func main() {
	app := pulse.New()
	router := pulse.NewRouter()

	router.Get("/profile/:name", func(ctx *pulse.Context) error {
		if ctx.Param("name") != "test" {
			ctx.Abort()
			ctx.Status(404)
			return nil
		}
		ctx.String("hello")
		ctx.Next()
		return nil
	})

	app.Router = router

	app.Run(":3000")
}

Available Middleware

  • CORS Middleware: Enable cross-origin resource sharing (CORS) with various options.
package main

import (
	"github.com/gopulse/pulse"
)

func main() {
	app := pulse.New()
	router := pulse.NewRouter()

	router.Get("/", func(ctx *pulse.Context) error {
		return nil
	})

	router.Use("GET", pulse.CORSMiddleware())

	app.Router = router

	app.Run(":3000")
}
  • Logger Middleware: Log every request with configurable options. (Coming soon)
  • Encrypt Cookie Middleware: Encrypt and decrypt cookie values. (Coming soon)
  • Timeout Middleware: Set a timeout for requests. (Coming soon)

License

Pulse is licensed under the MIT License. See LICENSE for the full license text.

Contributing

Contributions are welcome! Please read the contribution guidelines first.

Support

If you want to say thank you and/or support the active development of Pulse:

  1. Add a GitHub Star to the project.
  2. Tweet about the project on your Twitter
  3. Write a review or tutorial on Medium, dev.to, Reddit or personal blog.
  4. Buy Me a Coffee

Contributors

Stargarazers over time

Stargazers over time

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory