Documentation ¶
Index ¶
- Constants
- type Config
- func NewClientSecret(apiRoot, clientID, clientSecret string) (*Config, error)
- func NewFromCFHome() (*Config, error)
- func NewFromCFHomeDir(cfHomeDir string) (*Config, error)
- func NewToken(apiRoot, accessToken, refreshToken string) (*Config, error)
- func NewUserPassword(apiRootURL, username, password string) (*Config, error)
Constants ¶
const UserAgent = "Go-CF-Client/3.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { APIEndpointURL string LoginEndpointURL string UAAEndpointURL string Username string Password string ClientID string ClientSecret string UserAgent string Origin string AccessToken string RefreshToken string // contains filtered or unexported fields }
Config is used to configure the creation of a client
func NewClientSecret ¶
NewClientSecret creates a new config configured for client id and client secret authentication
func NewFromCFHome ¶
NewFromCFHome is similar to NewToken but reads the access token from the CF_HOME config, which must exist and have a valid access token.
This will use the currently configured CF_HOME env var if it exists, otherwise attempts to use the default CF_HOME directory.
func NewFromCFHomeDir ¶
NewFromCFHomeDir is similar to NewToken but reads the access token from the config in the specified directory which must exist and have a valid access token.
func NewToken ¶
NewToken creates a new config configured to use a static token
This method of authentication does _not_ support re-authentication, the access token and/or refresh token must be valid and created externally to this client.
If accessToken is empty, refreshToken must be non-empty and valid - an access token will be generated automatically using the refresh token.
func NewUserPassword ¶
NewUserPassword creates a new config configured for regular user/password authentication
func (*Config) HTTPClient ¶
HTTPClient returns the currently configured default base http.Client to be used as the base for all requests
func (*Config) RequestTimeout ¶
RequestTimeout returns the currently configured http.Client underlying transport request timeout
func (*Config) SkipTLSValidation ¶
SkipTLSValidation returns the currently configured http.Client underlying transport InsecureSkipVerify
func (*Config) WithHTTPClient ¶
WithHTTPClient overrides the default http.Client to be used as the base for all requests
The TLS and Timeout values on the http.Client will be set to match the config ¶
This is useful if you need to configure advanced http.Client or http.Transport settings, most consumers will not need to use this.
func (*Config) WithRequestTimeout ¶
WithRequestTimeout overrides the http.Client underlying transport request timeout
func (*Config) WithSkipTLSValidation ¶
WithSkipTLSValidation sets the http.Client underlying transport InsecureSkipVerify