/easy-sdk-go

Primary LanguageGoGNU General Public License v3.0GPL-3.0

easy-sdk-go Build Status

A set of simple functions to make life easier.

Install

go get -u "github.com/personal-security/easy-sdk-go"

Finctions

Listing functions is dev.

Example Rest Answer

package controllers

import (
    "net/http"
    "rest-api/models"

    "github.com/gorilla/mux"
    easysdk "github.com/personal-security/easy-sdk-go"
)

var StatusGetNow = func(w http.ResponseWriter, r *http.Request) {
    // CODE

    resp := &easysdk.RespondApi{}
    resp.Create(true, "Success")
    resp.Respond(w)
}

or

package controllers

import (
    "net/http"
    "rest-api/models"

    "github.com/gorilla/mux"
    easysdk "github.com/personal-security/easy-sdk-go"
)

var StatusGetNow = func(w http.ResponseWriter, r *http.Request) {
    // CODE

    easysdk.GenerateApiRespond(w,true,"Success",nil)
}

Links

pkg.go.dev