package
31.0.0
Repository: https://github.com/oracle/oci-go-sdk.git
Documentation: pkg.go.dev

# Packages

Package auth provides supporting functions and structs for authentication.

# Functions

Bool returns a pointer to the provided bool.
CloseBodyIfValid closes the body of an http response if the response and the body are valid.
CloseLogFile close the logging file and return error.
ComposingConfigurationProvider creates a composing configuration provider with the given slice of configuration providers A composing provider will return the configuration of the first provider that has the required property if no provider has the property it will return an error.
ConfigurationProviderEnvironmentVariables creates a ConfigurationProvider from a uniform set of environment variables starting with a prefix The env variables should look like: [prefix]_private_key_path, [prefix]_tenancy_ocid, [prefix]_user_ocid, [prefix]_fingerprint [prefix]_region.
ConfigurationProviderFromFile creates a configuration provider from a configuration file by reading the "DEFAULT" profile.
ConfigurationProviderFromFileWithProfile creates a configuration provider from a configuration file and the given profile.
CustomProfileConfigProvider returns the config provider of given profile.
Debug logs v if debug mode is set.
Debugf logs v with the provided format if debug mode is set.
Debugln logs v appending a new line if debug mode is set.
DefaultBaseClientWithSigner creates a default base client with a given signer.
DefaultBodyHeaders list of default body headers that is used in signing.
DefaultConfigProvider returns the default config provider.
DefaultGenericHeaders list of default generic headers that is used in signing.
DefaultRequestSigner creates a signer with default parameters.
EnableInstanceMetadataServiceLookup provides the interface to lookup IMDS region info.
Float32 returns a pointer to the provided float32.
Float64 returns a pointer to the provided float64.
GetBodyHash creates a base64 string from the hash of body the request.
HTTPRequestMarshaller marshals a structure to an http request using tag values in the struct The marshaller tag should like the following type A struct { ANumber string `contributesTo="query" name="number"` TheBody `contributesTo="body"` } where the contributesTo tag can be: header, path, query, body and the 'name' tag is the name of the value used in the http request(not applicable for path) If path is specified as part of the tag, the values are appened to the url path in the order they appear in the structure The current implementation only supports primitive types, except for the body tag, which needs a struct type.
IfDebug executes closure if debug is enabled.
IfInfo executes closure if info is enabled.
Int returns a pointer to the provided int.
Int64 returns a pointer to the provided int64.
IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error, this method will not check AuthType(), since authType() is not required to be there.
IsServiceError returns false if the error is not service side, otherwise true additionally it returns an interface representing the ServiceError.
Logf logs v with the provided format.
Logln logs v appending a new line at the endDeprecated.
MakeDefaultHTTPRequest creates the basic http request with the necessary headers set.
MakeDefaultHTTPRequestWithTaggedStruct creates an http request from an struct with tagged fields, see HTTPRequestMarshaller for more information.
NewClientWithConfig Create a new client with a configuration provider, the configuration provider will be used for the default signer as well as reading the region This function does not check for valid regions to implement forward compatibility.
NewClientWithOboToken Create a new client that will use oboToken for auth.
NewOCIOperationResponse assembles an OCI Operation Response object.
NewRawConfigurationProvider will create a ConfigurationProvider with the arguments of the function.
NewRetryPolicy is a helper method for assembling a Retry Policy object.
NewSDKDateFromString parses the dateString into SDKDate.
NewSignerFromOCIRequestSigner creates a copy of the request signer and attaches the new SignerBodyHashPredicate returns an error if the passed signer is not of type ociRequestSigner.
NoRetryPolicy is a helper method that assembles and returns a return policy that indicates an operation should never be retried (the operation is performed exactly once).
ParseContentLength trims whitespace from cl and returns -1 if can't purse uint, or the value if it's no less than 0.
PointerString prints the values of pointers in a structProducing a human friendly string for an struct with pointers.useful when debugging the values of a struct.
PrivateKeyFromBytes is a helper function that will produce a RSA private key from bytes.
PrivateKeyFromBytesWithPassword is a helper function that will produce a RSA private key from bytes and a password.
RequestSigner creates a signer that utilizes the specified headers for signing and the default predicate for using the body of the request as part of the signature.
RequestSignerExcludeBody creates a signer without hash the body.
RequestSignerWithBodyHashingPredicate creates a signer that utilizes the specified headers for signing, as well as a predicate for using the body of the request and bodyHeaders parameter as part of the signature.
Retry is a package-level operation that executes the retryable request using the specified operation and retry policy.
RetryToken generates a retry token that must be included on any request passed to the Retry method.
String returns a pointer to the provided string.
StringToRegion convert a string to Region type.
Uint returns a pointer to the provided uint.
UnmarshalResponse hydrates the fields of a struct with the values of a http response, guided by the field tags.
UnmarshalResponseWithPolymorphicBody similar to UnmarshalResponse but assumes the body of the response contains polymorphic json.
Version returns semantic version of the sdk.

# Constants

DefaultHostURLTemplate The default url template for service hosts.
InstancePrincipal is used for instance principle auth type.
InstancePrincipalDelegationToken is used for instance principle delegation token auth type.
RegionAPChiyoda1 region for Chiyoda.
RegionAPChuncheon1 region for Chuncheon.
RegionAPHyderabad1 region for Hyderabad.
RegionAPMelbourne1 region for Melbourne.
RegionAPMumbai1 region for Mumbai.
RegionAPOsaka1 region for Osaka.
RegionAPSeoul1 region for Seoul.
RegionAPSydney1 region for Sydney.
RegionAPTokyo1 region for Tokyo.
RegionCAMontreal1 region for Montreal.
RegionCAToronto1 region for Toronto.
RegionEUAmsterdam1 region for Amsterdam.
RegionEUZurich1 region for Zurich.
RegionFRA region FRA.
RegionIAD region IAD.
RegionLHR region LHR.
RegionMEDubai1 region for Dubai.
RegionMEJeddah1 region for Jeddah.
RegionPHX region PHX.
RegionSASantiago1 region for santiago.
RegionSASaopaulo1 region for Sao Paulo.
RegionSEA region SEA.
RegionSJC1 region SJC.
RegionUKCardiff1 region for Cardiff.
RegionUKGovCardiff1 gov region Cardiff.
RegionUKGovLondon1 gov region London.
RegionUSGovAshburn1 gov region Ashburn.
RegionUSGovChicago1 gov region Chicago.
RegionUSGovPhoenix1 region for Phoenix.
RegionUSLangley1 region for Langley.
RegionUSLuke1 region for Luke.
UnknownAuthenticationType is used for none meaningful auth type.
UnlimitedNumAttemptsValue is the value for indicating unlimited attempts for reaching success.
UserPrincipal is default auth type.

# Variables

DeadlineExceededByBackoff is the error returned by Call() when GetNextDuration() returns a time.Duration that would force the user to wait past the request deadline before re-issuing a request.

# Structs

AuthConfig is used for getting auth related paras in config file.
BaseClient struct implements all basic operations to call oci web services.
ClientCallDetails a set of settings used by the a single Call operation of the http Client.
CustomClientConfiguration contains configurations set at client level, currently it only includes RetryPolicy.
OCIOperationResponse represents the output of an OCIOperation, with additional context of error message and operation attempt number.
RequestMetadata is metadata about an OCIRequest.
RetryPolicy is the class that holds all relevant information for retrying operations.
SDKDate a struct that parses/renders to/from json using only date information.
SDKTime a struct that parses/renders to/from json using RFC339 date-time information.

# Interfaces

ConfigurationProvider wraps information about the account owner.
HTTPRequestDispatcher wraps the execution of a http request, it is generally implemented by http.Client.Do, but can be customized for testing.
HTTPRequestSigner the interface to sign a request.
KeyProvider interface that wraps information about the key's account owner.
OCIRequest is any request made to an OCI service.
OCIResponse is the response from issuing a request to an OCI service.
OCIRetryableRequest represents a request that can be reissued according to the specified policy.
PolymorphicJSONUnmarshaler is the interface to unmarshal polymorphic json payloads.
ServiceError models all potential errors generated the service call.

# Type aliases

AuthenticationType for auth.
OCIOperation is the generalization of a request-response cycle undergone by an OCI service.
Region type for regions.
RequestInterceptor function used to customize the request before calling the underlying service.
SignerBodyHashPredicate a function that allows to disable/enable body hashing of requests and headers associated with body content.