Documentation ¶
Index ¶
- Constants
- func PrepareRedirect(req *http.Request, via []*http.Request) error
- func Sanitize(input string) (sanitized string)
- func TraceEnabled() bool
- type ApiResponse
- func NewApiResponse(message string, errorCode string, statusCode int) (apiResponse ApiResponse)
- func NewApiResponseWithError(message string, err error) (apiResponse ApiResponse)
- func NewApiResponseWithMessage(message string, a ...interface{}) (apiResponse ApiResponse)
- func NewNotFoundApiResponse(message string, a ...interface{}) (apiResponse ApiResponse)
- func NewSuccessfulApiResponse() (apiResponse ApiResponse)
- type Gateway
- func (gateway Gateway) CreateResource(url, accessToken string, body io.ReadSeeker) (apiResponse ApiResponse)
- func (gateway Gateway) CreateResourceForResponse(url, accessToken string, body io.ReadSeeker, resource interface{}) (apiResponse ApiResponse)
- func (gateway Gateway) DeleteResource(url, accessToken string) (apiResponse ApiResponse)
- func (gateway Gateway) GetResource(url, accessToken string, resource interface{}) (apiResponse ApiResponse)
- func (gateway Gateway) NewRequest(method, path, accessToken string, body io.ReadSeeker) (req *Request, apiResponse ApiResponse)
- func (gateway Gateway) PerformRequest(request *Request) (apiResponse ApiResponse)
- func (gateway Gateway) PerformRequestForJSONResponse(request *Request, response interface{}) (headers http.Header, apiResponse ApiResponse)
- func (gateway Gateway) PerformRequestForResponseBytes(request *Request) (bytes []byte, headers http.Header, apiResponse ApiResponse)
- func (gateway Gateway) PerformRequestForTextResponse(request *Request) (response string, headers http.Header, apiResponse ApiResponse)
- func (gateway *Gateway) SetTokenRefresher(auth tokenRefresher)
- func (gateway Gateway) UpdateResource(url, accessToken string, body io.ReadSeeker) (apiResponse ApiResponse)
- func (gateway Gateway) UpdateResourceForResponse(url, accessToken string, body io.ReadSeeker, resource interface{}) (apiResponse ApiResponse)
- type Request
Constants ¶
View Source
const INVALID_TOKEN_CODE = "GATEWAY INVALID TOKEN CODE"
View Source
const (
PRIVATE_DATA_PLACEHOLDER = "[PRIVATE DATA HIDDEN]"
)
Variables ¶
This section is empty.
Functions ¶
func TraceEnabled ¶
func TraceEnabled() bool
Types ¶
type ApiResponse ¶
type ApiResponse struct { Message string ErrorCode string StatusCode int // contains filtered or unexported fields }
func NewApiResponse ¶
func NewApiResponse(message string, errorCode string, statusCode int) (apiResponse ApiResponse)
func NewApiResponseWithError ¶
func NewApiResponseWithError(message string, err error) (apiResponse ApiResponse)
func NewApiResponseWithMessage ¶
func NewApiResponseWithMessage(message string, a ...interface{}) (apiResponse ApiResponse)
func NewNotFoundApiResponse ¶
func NewNotFoundApiResponse(message string, a ...interface{}) (apiResponse ApiResponse)
func NewSuccessfulApiResponse ¶
func NewSuccessfulApiResponse() (apiResponse ApiResponse)
func (ApiResponse) IsError ¶
func (apiResponse ApiResponse) IsError() bool
func (ApiResponse) IsNotFound ¶
func (apiResponse ApiResponse) IsNotFound() bool
func (ApiResponse) IsNotSuccessful ¶
func (apiResponse ApiResponse) IsNotSuccessful() bool
func (ApiResponse) IsSuccessful ¶
func (apiResponse ApiResponse) IsSuccessful() bool
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewCloudControllerGateway ¶
func NewCloudControllerGateway() Gateway
func NewUAAGateway ¶
func NewUAAGateway() Gateway
func (Gateway) CreateResource ¶
func (gateway Gateway) CreateResource(url, accessToken string, body io.ReadSeeker) (apiResponse ApiResponse)
func (Gateway) CreateResourceForResponse ¶
func (gateway Gateway) CreateResourceForResponse(url, accessToken string, body io.ReadSeeker, resource interface{}) (apiResponse ApiResponse)
func (Gateway) DeleteResource ¶
func (gateway Gateway) DeleteResource(url, accessToken string) (apiResponse ApiResponse)
func (Gateway) GetResource ¶
func (gateway Gateway) GetResource(url, accessToken string, resource interface{}) (apiResponse ApiResponse)
func (Gateway) NewRequest ¶
func (gateway Gateway) NewRequest(method, path, accessToken string, body io.ReadSeeker) (req *Request, apiResponse ApiResponse)
func (Gateway) PerformRequest ¶
func (gateway Gateway) PerformRequest(request *Request) (apiResponse ApiResponse)
func (Gateway) PerformRequestForJSONResponse ¶
func (gateway Gateway) PerformRequestForJSONResponse(request *Request, response interface{}) (headers http.Header, apiResponse ApiResponse)
func (Gateway) PerformRequestForResponseBytes ¶
func (Gateway) PerformRequestForTextResponse ¶
func (*Gateway) SetTokenRefresher ¶
func (gateway *Gateway) SetTokenRefresher(auth tokenRefresher)
func (Gateway) UpdateResource ¶
func (gateway Gateway) UpdateResource(url, accessToken string, body io.ReadSeeker) (apiResponse ApiResponse)
func (Gateway) UpdateResourceForResponse ¶
func (gateway Gateway) UpdateResourceForResponse(url, accessToken string, body io.ReadSeeker, resource interface{}) (apiResponse ApiResponse)
Click to show internal directories.
Click to hide internal directories.