token

package
v0.0.0-...-1aaa49d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: BSD-2-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetToken functions.TokenFunc = func(info *functions.Info) (token string, err error) {
	fmt.Println("Getting token.............")
	entity := http.HttpRequestEntity{
		Url:      fmt.Sprintf("%s/oauth/token?grant_type=client_credentials", info.Uaaurl),
		Username: info.Clientid,
		Password: info.Secret,
	}
	httpGateway := NewGateway()
	request := httpGateway.Post(entity, nil)
	response, err := request()
	if err != nil {
		return
	}
	return parse(response)
}
View Source
var NewGateway = func() http.HttpGateway {
	return http.NewHttpGateway()
}

Functions

func RequestWithToken

func RequestWithToken(token, url, method, contentType string, body io.Reader) (response *http.Response, err error)

Types

type Token

type Token struct {
	AccessToken string `json:"access_token"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL