Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
github.com/srfrog/go-relax
Build fast and complete RESTful APIs in Go
Go-Relax aims to provide the tools to help developers build RESTful web services, and information needed to abide by REST architectural constraints using correct HTTP semantics.
Install using "go get":
go get github.com/srfrog/go-relax
Then import from your source:
import "github.com/srfrog/go-relax"
View example_test.go for an extended example of basic usage and features.
Also, check the wiki for HowTo's and recipes.
http.ServeMux
or independently as http.Handler
sync.pool
to efficiently use resources when under heavy load.The full code documentation is located at GoDoc:
https://pkg.go.dev/github.com/srfrog/go-relax
The source code is thoroughly commented, have a look.
This minimal example creates a new Relax service that handles a Hello resource.
package main
import (
"github.com/srfrog/go-relax"
)
type Hello string
func (h *Hello) Index(ctx *relax.Context) {
ctx.Respond(h)
}
func main() {
h := Hello("hello world!")
svc := relax.NewService("http://api.company.com/")
svc.Resource(&h)
svc.Run()
}
$ curl -i -X GET http://api.company.com/hello
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Link: </hello>; rel="self"
Link: </hello>; rel="index"
Request-Id: 61d430de-7bb6-4ff8-84da-aff6fe81c0d2
Server: Go-Relax/0.5.0
Date: Thu, 14 Aug 2014 06:20:48 GMT
Content-Length: 14
"hello world!"
Go-Relax is Copyright (c) Codehack. Published under an MIT License
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.