Skip to content

fabysdev/fabyscore-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FabysCore GO

Build Status Coverage Status Go Report Card

Warning

The API is not yet stable! Some things will change.
Please wait for a 1.0 release if you're not willing to update your code frequently.

Components

Server

HTTP Server Router

package main

import "github.com/fabysdev/fabyscore-go/server"
import "net/http"
import "fmt"

func main() {
  srv := server.New();

  srv.GET("/", fabyscoreHandler)

  srv.Run(":8080")
}

func fabyscoreHandler(w http.ResponseWriter, r *http.Request) {
  fmt.Fprint(w, "Hello!")
}

File Server

Only serves files and not the directory.

srv.ServeFiles("/", http.Dir("./"))

Middleware

net/http middleware handlers.

package main

import "github.com/fabysdev/fabyscore-go/middleware"

func main() {
  timeout := middleware.Timeout(1*time.Second)
}

Cache

In-Memory key-value store/cache.

package main

import "github.com/fabysdev/fabyscore-go/cache"

func main() {
  // create new cache
  c := cache.New()

  // add an item
  c.Set("key", "value")

  // get an item
  item, found := c.Get("key")

  // delete an item
  c.Delete("key")
}

License

Code and documentation released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages