util

package
v0.0.0-...-05e590e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2020 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForActive

func WaitForActive(ctx context.Context, client *binarylane.Client, monitorURI string) error

WaitForActive waits for a server to become active

Example
// build client
pat := "mytoken"
token := &oauth2.Token{AccessToken: pat}
t := oauth2.StaticTokenSource(token)

ctx := context.TODO()
oauthClient := oauth2.NewClient(ctx, t)
client := binarylane.NewClient(oauthClient)

// create your server and retrieve the create action uri
uri := "https://api.binarylane.com.au/v2/actions/xxxxxxxx"

// block until until the action is complete
err := WaitForActive(ctx, client, uri)
if err != nil {
	panic(err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL