Documentation
¶
Index ¶
Constants ¶
View Source
const ( TokenTypeBearer = "Bearer" PathApp = "/v2/apps" CFAppNotFound = "CF-AppNotFound" )
View Source
const ( PathCFInfo = "/v2/info" PathCFAuth = "/oauth/token" PathIntrospectToken = "/introspect" GrantTypeClientCredentials = "client_credentials" GrantTypeRefreshToken = "refresh_token" TimeToRefreshBeforeTokenExpire time.Duration = 10 * time.Minute )
View Source
const ( ServiceInstancesPath = "/v2/service_instances" ServicePlansPath = "v2/service_plans" ResultsPerPageParam = "results-per-page" )
View Source
const (
CCAdminScope = "cloud_controller.admin"
)
Variables ¶
View Source
var ( ErrUnauthrorized = fmt.Errorf(http.StatusText(http.StatusUnauthorized)) ErrInvalidTokenFormat = fmt.Errorf("Invalid token format") )
Functions ¶
This section is empty.
Types ¶
type CFClient ¶
type CFClient interface {
Login() error
RefreshAuthToken() (string, error)
GetTokens() (Tokens, error)
GetEndpoints() Endpoints
GetApp(string) (*models.AppEntity, error)
SetAppInstances(string, int) error
IsUserAdmin(userToken string) (bool, error)
IsUserSpaceDeveloper(userToken string, appId string) (bool, error)
IsTokenAuthorized(token, clientId string) (bool, error)
GetServiceInstancesInOrg(orgGUID, servicePlanGuid string) (int, error)
GetServicePlan(serviceInstanceGuid string) (string, error)
}
type CFConfig ¶
type IntrospectionResponse ¶
type ServiceInstanceEntity ¶
type ServiceInstanceEntity struct {
ServicePlanGuid string `json:"service_plan_guid"`
}
type ServiceInstanceResource ¶
type ServiceInstanceResource struct {
Entity ServiceInstanceEntity `json:"entity"`
}
type ServicePlanEntity ¶
type ServicePlanEntity struct {
UniqueId string `json:"unique_id"`
}
type ServicePlanResource ¶
type ServicePlanResource struct {
Entity ServicePlanEntity `json:"entity"`
}
Click to show internal directories.
Click to hide internal directories.