Documentation ¶
Index ¶
- Variables
- func CommonHeader(lreq *http.Request, token, format string)
- func ReqToResponse(creq *http.Request) (*http.Response, error)
- func SetHeaderWith(req *http.Request) *http.Request
- func SetHeaderWithJWT(jwt string) func(*http.Request) *http.Request
- func SetHeaderWithToken(token string) func(*http.Request) *http.Request
- type JSONPayload
- type ResponseFeedback
- type TokenManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WithJWT = F.Flow2( S.Format[string]("JWT %s"), B.WithAuthorization, ) WithToken = F.Flow2( S.Format[string]("Token %s"), B.WithAuthorization, ) MakeHTTPRequest = F.Bind13of3(H.MakeRequest) )
Functions ¶
func CommonHeader ¶
Types ¶
type JSONPayload ¶
func OnJSONPayloadError ¶
func OnJSONPayloadError(err error) JSONPayload
func OnJSONPayloadSuccess ¶
func OnJSONPayloadSuccess(resp []byte) JSONPayload
type ResponseFeedback ¶
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
func NewTokenManager ¶
func NewTokenManager( host, tokenFile string, ) (*TokenManager, error)
func (*TokenManager) FreshToken ¶
func (tkm *TokenManager) FreshToken() (string, error)
func (*TokenManager) RefreshTokenURL ¶
func (tkm *TokenManager) RefreshTokenURL() string
Click to show internal directories.
Click to hide internal directories.