oci-go-sdk: github.com/oracle/oci-go-sdk/example/helpers Index | Files

package helpers

import "github.com/oracle/oci-go-sdk/example/helpers"


Package Files

args.go helper.go

func AvailabilityDomain Uses

func AvailabilityDomain() *string

AvailabilityDomain return the aviailability domain defined in .env.sample file

func CheckLifecycleState Uses

func CheckLifecycleState(lifecycleState string) func(interface{}) (bool, error)

CheckLifecycleState returns a function that checks for that a struct has the given lifecycle

func CompartmentID Uses

func CompartmentID() *string

CompartmentID return the compartment ID defined in .env.sample file

func FatalIfError Uses

func FatalIfError(err error)

FatalIfError is equivalent to Println() followed by a call to os.Exit(1) if error is not nil

func FindLifecycleFieldValue Uses

func FindLifecycleFieldValue(request interface{}) (string, error)

FindLifecycleFieldValue finds lifecycle value inside the struct based on reflection

func GetRandomString Uses

func GetRandomString(n int) string

GetRandomString returns a random string with length equals to n

func GetRequestMetadataWithCustomizedRetryPolicy Uses

func GetRequestMetadataWithCustomizedRetryPolicy(fn func(r common.OCIOperationResponse) bool) common.RequestMetadata

GetRequestMetadataWithCustomizedRetryPolicy returns a requestMetadata which will do the retry based on input function (retry until the function return false)

func GetRequestMetadataWithDefaultRetryPolicy Uses

func GetRequestMetadataWithDefaultRetryPolicy() common.RequestMetadata

GetRequestMetadataWithDefaultRetryPolicy returns a requestMetadata with default retry policy which will do retry for non-200 status code return back from service Notes: not all non-200 status code should do retry, this should be based on specific operation such as delete operation followed with get operation will retrun 404 if resource already been deleted

func ParseEnvironmentVariables Uses

func ParseEnvironmentVariables()

ParseEnvironmentVariables parse shared variables from environment variables, other samples should define their own viariables and call this function to initialize shared variables

func RetryUntilTrueOrError Uses

func RetryUntilTrueOrError(operation func() (interface{}, error), predicate func(interface{}) (bool, error), frequency, timeout <-chan time.Time) error

RetryUntilTrueOrError retries a function until the predicate is true or it reaches a timeout. The operation is retried at the give frequency

func RootCompartmentID Uses

func RootCompartmentID() *string

RootCompartmentID return the root compartment ID defined in .env.sample file

func WriteTempFileOfSize Uses

func WriteTempFileOfSize(filesize int64) (fileName string, fileSize int64)

WriteTempFileOfSize output random content to a file

Package helpers imports 12 packages (graph). Updated 2019-05-10. Refresh now. Tools for package owners.