Documentation ¶
Index ¶
- Constants
- func CalculateHash(v interface{}) (string, error)
- func CalculateHashFromByteArray(b []byte) string
- func ExtractParam(param url.Values, name string) string
- func ParsePost(request *http.Request, body interface{}) error
- func RespondWithError(w http.ResponseWriter, code int, msg string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func Serialize(v interface{}) string
- func VersioneSoftware() interface{}
- type RestClient
Constants ¶
View Source
const ( ContentType = "Content-Type" ApplicationJSON = "application/json; charset=UTF-8" )
Costanti
Variables ¶
This section is empty.
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, msg string)
RespondWithError : funzione per la restituzione di un errore JSON
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON : funzione per la restituzione di una risposta JSON
func VersioneSoftware ¶
func VersioneSoftware() interface{}
VersioneSoftware recupera la versione implementata dei servizi REST
Types ¶
type RestClient ¶
RestClient : struttura per le chiamate http client con zipkin
func GetRestClient ¶
func GetRestClient(uri string) *RestClient
GetRestClient : metodo per il recupero della struttura RestClient
func RestClientFactory ¶
func RestClientFactory(url *url.URL, httpClient *zipkinhttp.Client, config *config.Config) *RestClient
RestClientFactory factory rest client
func (*RestClient) Do ¶
func (rs *RestClient) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)
Do esegue una chiamata rest
func (*RestClient) NewRequest ¶
func (rs *RestClient) NewRequest(method, path string, body interface{}) (*http.Request, error)
NewRequest : crea una nuova richiesta http
Click to show internal directories.
Click to hide internal directories.