Documentation
¶
Index ¶
- Constants
- func GetAuthenticatorFromEnvironment(credentialKey string) (core.Authenticator, error)
- func GetSdkAnalyticsHeader(serviceName string, serviceVersion string, operationID string) string
- func GetSdkHeaders(serviceName string, serviceVersion string, operationID string) map[string]string
- type BaseService
Constants ¶
const Version = "0.7.0"
Version of the SDK
Variables ¶
This section is empty.
Functions ¶
func GetAuthenticatorFromEnvironment ¶ added in v0.0.39
func GetAuthenticatorFromEnvironment(credentialKey string) (core.Authenticator, error)
GetAuthenticatorFromEnvironment instantiates an Authenticator using service properties retrieved from external config sources.
func GetSdkAnalyticsHeader ¶ added in v0.0.25
func GetSdkHeaders ¶
GetSdkHeaders - returns the set of SDK-specific headers to be included in an outgoing request.
This function is invoked by generated service methods (i.e. methods which implement the REST API operations defined within the API definition). The purpose of this function is to give the SDK implementor the opportunity to provide SDK-specific HTTP headers that will be sent with an outgoing REST API request. This function is invoked for each invocation of a generated service method, so the set of HTTP headers could be request-specific.
Parameters:
serviceName - the name of the service as defined in the API definition (e.g. "MyService1") serviceVersion - the version of the service as defined in the API definition (e.g. "V1") operationId - the operationId as defined in the API definition (e.g. getContext)
Returns:
a Map which contains the set of headers to be included in the REST API request
Types ¶
type BaseService ¶ added in v0.0.36
type BaseService struct {
*core.BaseService
// contains filtered or unexported fields
}
func NewBaseService ¶ added in v0.0.36
func NewBaseService(opts *core.ServiceOptions) (*BaseService, error)
func (*BaseService) Clone ¶ added in v0.0.36
func (c *BaseService) Clone() *BaseService
func (*BaseService) Request ¶ added in v0.0.36
func (c *BaseService) Request(req *http.Request, result interface{}) (detailedResponse *core.DetailedResponse, err error)
func (*BaseService) SetHTTPClient ¶ added in v0.5.0
func (c *BaseService) SetHTTPClient(client *http.Client)
SetHTTPClient will set "client" as the http.Client instance to be used to invoke individual HTTP requests. If automatic retries are currently enabled on "service", then "client" will be set as the embedded client instance within the retryable client; otherwise "client" will be stored directly on "service".
func (*BaseService) SetServiceURL ¶ added in v0.0.36
func (c *BaseService) SetServiceURL(url string) error