module
0.0.0-20231226231630-6c9b677bae35
Repository: https://github.com/vithubati/go-core.git
Documentation: pkg.go.dev
# README
go-core
This repository contains implementation of some core go libs
How to use
installing
go get github.com/vithubati/go-core
Usage
Authenticator
- Add core module to import statement.
import "github.com/vithubati/go -core/<package>
- Creat an authenticator for the client
authenticator, err := NewBasicAuthenticator ( "username", "password")
Http Client
- Creating a client
auth, _ := authenticator.NewBearerTokenAuthenticator("Test-TOKEN")
client := New(WithAuthenticator(auth))
- Creating a request
auth, _ := authenticator.NewBearerTokenAuthenticator("Test-TOKEN")
client := New(WithAuthenticator(auth))
params := url.Values{}
params.Set("limit", "5")
params.Set("size", "10")
ctx := context.Background()
url := "https://gobyexample.com/"
req := client.RequestWithCtx(ctx, url, http.MethodGet, nil, params)
- Executing a request
resp, err := client.Execute(req)
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author