client

package
v0.0.0-...-7199896 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: Apache-2.0 Imports: 10 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetApplications(queryParams url.Values) ([]byte, error)
	GetResource(path string) ([]byte, error)
	GetResources(path string, limit int) ([]byte, error)

	TokensUpdated() bool
	GetUpdatedTokens() (string, string)
}

func NewClient

func NewClient(ccEndpoint, uaaEndpoint, accessToken, refreshToken string) Client

type Fetcher

type Fetcher interface {
	Fetch(req *http.Request) ([]byte, error)
	GetUpdatedTokens() (string, string)
}

func NewBaseFetcher

func NewBaseFetcher(tokenRefresher TokenRefresher, refreshToken string) Fetcher

func NewPaginatedResourceFetcher

func NewPaginatedResourceFetcher(
	limit int,
	baseFetcher Fetcher,
	refreshToken string,
) Fetcher

type GetResourcesResponse

type GetResourcesResponse struct {
	Pagination Pagination    `json:"pagination,omitempty"`
	Resources  []interface{} `json:"resources,omitempty"`
}
type Link struct {
	Href string `json:"href"`
}

type Pagination

type Pagination struct {
	TotalResults *int    `json:"total_results"`
	First        *Link   `json:"first"`
	Last         *Link   `json:"last"`
	Next         *string `json:"next"`
	Previous     *string `json:"previous"`
}

type TokenRefresher

type TokenRefresher interface {
	Refresh(oldRefreshToken string) (string, string, error)
}

func NewTokenRefresher

func NewTokenRefresher(uaaEndpoint string) TokenRefresher

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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