Documentation
¶
Index ¶
- Constants
- Variables
- func NewClient(cfg *Config, options ...func(*client)) (*client, error)
- func WithHTTPClient(c *http.Client) func(*client)
- func WithRetryPause(t time.Duration) func(*client)
- func WithRetryTimeout(t time.Duration) func(*client)
- type APIClient
- type Cache
- type CachingClient
- func (c *CachingClient) GetOrgByGuid(orgGUID string) (cfclient.Org, error)
- func (c *CachingClient) GetOrgByName(name string) (cfclient.Org, error)
- func (c *CachingClient) GetServiceByGuid(serviceGUID string) (cfclient.Service, error)
- func (c *CachingClient) GetServicePlanByGUID(servicePlanGUID string) (*cfclient.ServicePlan, error)
- func (c *CachingClient) GetSpaceByGuid(spaceGUID string) (cfclient.Space, error)
- func (c *CachingClient) GetSpaceByName(name string, orgGUID string) (cfclient.Space, error)
- func (c *CachingClient) ListOrgs() ([]cfclient.Org, error)
- func (c *CachingClient) ListSpaces() ([]cfclient.Space, error)
- type Client
- type Config
Constants ¶
View Source
const ( // DefaultRetryTimeout sets the amount of time before a retry times out DefaultRetryTimeout = time.Minute // DefaultRetryPause sets the amount of time to wait before retrying DefaultRetryPause = 3 * time.Second )
Variables ¶
View Source
var ErrRetry = errors.New("retry")
Functions ¶
func WithHTTPClient ¶
func WithRetryPause ¶
func WithRetryTimeout ¶
Types ¶
type APIClient ¶
type APIClient interface { BindRoute(routeGUID, appGUID string) error CreateApp(request cfclient.AppCreateRequest) (cfclient.App, error) CreateOrg(req cfclient.OrgRequest) (cfclient.Org, error) CreateSpace(req cfclient.SpaceRequest) (cfclient.Space, error) CreateRoute(request cfclient.RouteRequest) (cfclient.Route, error) CreateServiceBinding(appGUID, serviceInstanceGUID string) (*cfclient.ServiceBinding, error) DeleteApp(guid string) error DeleteOrg(guid string, recursive, async bool) error DoRequest(req *cfclient.Request) (*http.Response, error) Do(req *http.Request) (*http.Response, error) AppByName(appName, spaceGuid, orgGuid string) (cfclient.App, error) GetAppByGuidNoInlineCall(guid string) (cfclient.App, error) GetDomainByName(name string) (cfclient.Domain, error) GetOrgByGuid(guid string) (cfclient.Org, error) GetOrgByName(name string) (cfclient.Org, error) GetOrgQuotaByName(name string) (cfclient.OrgQuota, error) GetSpaceByGuid(guid string) (cfclient.Space, error) GetSpaceByName(name string, orgGUID string) (cfclient.Space, error) GetStackByGuid(guid string) (cfclient.Stack, error) ListOrgs() ([]cfclient.Org, error) ListSpaces() ([]cfclient.Space, error) ListAppsByQuery(params url.Values) ([]cfclient.App, error) ListOrgsByQuery(params url.Values) ([]cfclient.Org, error) ListRoutesByQuery(params url.Values) ([]cfclient.Route, error) ListServiceInstancesByQuery(params url.Values) ([]cfclient.ServiceInstance, error) ListSpacesByQuery(query url.Values) ([]cfclient.Space, error) ListStacksByQuery(params url.Values) ([]cfclient.Stack, error) ListUserProvidedServiceInstancesByQuery(params url.Values) ([]cfclient.UserProvidedServiceInstance, error) NewRequest(method, path string) *cfclient.Request NewRequestWithBody(method, path string, body io.Reader) *cfclient.Request UpdateApp(guid string, aur cfclient.AppUpdateResource) (cfclient.UpdateResponse, error) UpdateV3App(guid string, req cfclient.UpdateV3AppRequest) (*cfclient.V3App, error) UploadAppBits(io.Reader, string) error UploadDropletBits(io.Reader, string) (string, error) }
APIClient defines requests that can be made to the APIClient API
type Cache ¶
func (*Cache) Load ¶
Load retrieves the item from the cache if exists. Returns the val and true if it exists otherwise false.
func (*Cache) LoadOrStore ¶
LoadOrStore atomically returns the already stored object if found and true, otherwise it stores the given object, returns val and false
type CachingClient ¶
type CachingClient struct { *cfclient.Client // contains filtered or unexported fields }
func NewCachingClient ¶
func NewCachingClient(client *cfclient.Client) *CachingClient
func (*CachingClient) GetOrgByGuid ¶
func (c *CachingClient) GetOrgByGuid(orgGUID string) (cfclient.Org, error)
func (*CachingClient) GetOrgByName ¶
func (c *CachingClient) GetOrgByName(name string) (cfclient.Org, error)
func (*CachingClient) GetServiceByGuid ¶
func (c *CachingClient) GetServiceByGuid(serviceGUID string) (cfclient.Service, error)
func (*CachingClient) GetServicePlanByGUID ¶
func (c *CachingClient) GetServicePlanByGUID(servicePlanGUID string) (*cfclient.ServicePlan, error)
func (*CachingClient) GetSpaceByGuid ¶
func (c *CachingClient) GetSpaceByGuid(spaceGUID string) (cfclient.Space, error)
func (*CachingClient) GetSpaceByName ¶
func (c *CachingClient) GetSpaceByName(name string, orgGUID string) (cfclient.Space, error)
func (*CachingClient) ListOrgs ¶
func (c *CachingClient) ListOrgs() ([]cfclient.Org, error)
func (*CachingClient) ListSpaces ¶
func (c *CachingClient) ListSpaces() ([]cfclient.Space, error)
type Config ¶
type Config struct { AccessToken string RefreshToken string Target string AuthorizationEndpoint string OrganizationFields struct { Name string } SpaceFields struct { Name string } SSLDisabled bool Username string Password string ClientID string ClientSecret string // contains filtered or unexported fields }
func (*Config) HTTPClient ¶
Click to show internal directories.
Click to hide internal directories.