Documentation ¶
Index ¶
- Constants
- Variables
- func NewTLSConfig(trustedCerts []tls.Certificate, disableSSL bool) (TLSConfig *tls.Config)
- func WrapNetworkErrors(host string, err error) error
- type AsyncResource
- type Gateway
- func NewCloudControllerGateway(config coreconfig.Reader, clock func() time.Time, ui terminal.UI, ...) Gateway
- func NewRoutingAPIGateway(config coreconfig.Reader, clock func() time.Time, ui terminal.UI, ...) Gateway
- func NewUAAGateway(config coreconfig.Reader, ui terminal.UI, logger trace.Printer) Gateway
- func (gateway *Gateway) AsyncTimeout() time.Duration
- func (gateway Gateway) CreateResource(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
- func (gateway Gateway) CreateResourceFromStruct(endpoint, url string, resource interface{}) error
- func (gateway Gateway) DeleteResource(endpoint, apiURL string) error
- func (gateway Gateway) DeleteResourceSynchronously(endpoint, apiURL string) error
- func (gateway Gateway) GetResource(url string, resource interface{}) (err error)
- func (gateway Gateway) ListPaginatedResources(target string, path string, resource interface{}, cb func(interface{}) bool) error
- func (gateway Gateway) NewRequest(method, path, accessToken string, body io.ReadSeeker) (*Request, error)
- func (gateway Gateway) NewRequestForFile(method, fullURL, accessToken string, body *os.File) (*Request, error)
- func (gateway Gateway) PerformPollingRequestForJSONResponse(endpoint string, request *Request, response interface{}, timeout time.Duration) (headers http.Header, apiErr error)
- func (gateway Gateway) PerformRequest(request *Request) (rawResponse *http.Response, apiErr error)
- func (gateway Gateway) PerformRequestForJSONResponse(request *Request, response interface{}) (headers http.Header, apiErr error)
- func (gateway Gateway) PerformRequestForTextResponse(request *Request) (response string, headers http.Header, apiErr error)
- func (gateway *Gateway) SetTokenRefresher(auth tokenRefresher)
- func (gateway *Gateway) SetTrustedCerts(certificates []tls.Certificate)
- func (gateway Gateway) UpdateResource(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
- func (gateway Gateway) UpdateResourceFromStruct(endpoint, apiURL string, resource interface{}) error
- func (gateway Gateway) UpdateResourceSync(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
- func (gateway Gateway) Warnings() []string
- type HTTPClientInterface
- type JobResource
- type PaginatedResources
- type ProgressReader
- type Request
- type RequestDumper
- type RequestDumperInterface
- type WarningProducer
- type WarningsCollector
Constants ¶
View Source
const ( JOB_FINISHED = "finished" JOB_FAILED = "failed" DEFAULT_POLLING_THROTTLE = 5 * time.Second )
View Source
const DeprecatedEndpointWarning = "Endpoint deprecated"
Variables ¶
View Source
var NewHTTPClient = func(tr *http.Transport, dumper RequestDumper) HTTPClientInterface { c := client{ &http.Client{ Transport: tr, }, dumper, } c.CheckRedirect = c.checkRedirect return &c }
Functions ¶
func NewTLSConfig ¶
func NewTLSConfig(trustedCerts []tls.Certificate, disableSSL bool) (TLSConfig *tls.Config)
func WrapNetworkErrors ¶
Types ¶
type AsyncResource ¶
type AsyncResource struct { Metadata struct { URL string } }
type Gateway ¶
type Gateway struct { PollingEnabled bool PollingThrottle time.Duration Clock func() time.Time // contains filtered or unexported fields }
func NewRoutingAPIGateway ¶
func NewUAAGateway ¶
func (*Gateway) AsyncTimeout ¶
func (Gateway) CreateResource ¶
func (gateway Gateway) CreateResource(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
func (Gateway) CreateResourceFromStruct ¶
func (Gateway) DeleteResource ¶
func (Gateway) DeleteResourceSynchronously ¶
func (Gateway) GetResource ¶
func (Gateway) ListPaginatedResources ¶
func (Gateway) NewRequest ¶
func (Gateway) NewRequestForFile ¶
func (Gateway) PerformPollingRequestForJSONResponse ¶
func (Gateway) PerformRequest ¶
func (Gateway) PerformRequestForJSONResponse ¶
func (Gateway) PerformRequestForTextResponse ¶
func (*Gateway) SetTokenRefresher ¶
func (gateway *Gateway) SetTokenRefresher(auth tokenRefresher)
func (*Gateway) SetTrustedCerts ¶
func (gateway *Gateway) SetTrustedCerts(certificates []tls.Certificate)
func (Gateway) UpdateResource ¶
func (gateway Gateway) UpdateResource(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
func (Gateway) UpdateResourceFromStruct ¶
func (Gateway) UpdateResourceSync ¶
func (gateway Gateway) UpdateResourceSync(endpoint, apiURL string, body io.ReadSeeker, resource ...interface{}) error
type HTTPClientInterface ¶
type JobResource ¶
type PaginatedResources ¶
type PaginatedResources struct { NextURL string `json:"next_url"` ResourcesBytes json.RawMessage `json:"resources"` // contains filtered or unexported fields }
func NewPaginatedResources ¶
func NewPaginatedResources(exampleResource interface{}) PaginatedResources
func (PaginatedResources) Resources ¶
func (pr PaginatedResources) Resources() ([]interface{}, error)
type ProgressReader ¶
type ProgressReader struct {
// contains filtered or unexported fields
}
func NewProgressReader ¶
func NewProgressReader(readSeeker io.ReadSeeker, ui terminal.UI, outputInterval time.Duration) *ProgressReader
func (*ProgressReader) Seek ¶
func (progressReader *ProgressReader) Seek(offset int64, whence int) (int64, error)
func (*ProgressReader) SetTotalSize ¶
func (progressReader *ProgressReader) SetTotalSize(size int64)
type RequestDumper ¶
type RequestDumper struct {
// contains filtered or unexported fields
}
func NewRequestDumper ¶
func NewRequestDumper(printer trace.Printer) RequestDumper
func (RequestDumper) DumpRequest ¶
func (p RequestDumper) DumpRequest(req *http.Request)
func (RequestDumper) DumpResponse ¶
func (p RequestDumper) DumpResponse(res *http.Response)
type RequestDumperInterface ¶
type WarningProducer ¶
type WarningProducer interface {
Warnings() []string
}
type WarningsCollector ¶
type WarningsCollector struct {
// contains filtered or unexported fields
}
func NewWarningsCollector ¶
func NewWarningsCollector(ui terminal.UI, warning_producers ...WarningProducer) (warnings_collector WarningsCollector)
func (WarningsCollector) PrintWarnings ¶
func (warnings_collector WarningsCollector) PrintWarnings()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.