edgio-go-sdk

internal/client

This package provides a base client configuration and connection to Edgio’s REST API, as well as configuration validation. The public packages under edgio namespace uses this client under the hood to perform their API calls.

client.New(creds common.Creds, config common.ClientConfig) (client.Client, error)

This constructor validates and assing default valued (if applicable) to the provided credentials and configurations and returns a client instance with a valid access token, or an error if anything goes wrong.

  client.New(
    common.Creds{Key: string, Secret: string, Scopes: string, AuthURL string},
    common.ClientConfig{Url: string, ApiVersion string, Service: string, Scope: string, OrgId: string}
)

client.New Mandatory Params

client.New Optional Params & Default Values

client.GetServiceURL(params common.URLParams) string

This function generates the fully formatted Edgio REST API’s url for the desired resource, identified by its service, scope and apiVersion.

// edgioClient returned from  client.New()
orgPropertyUrl := edgioClient.GetServiceURL(common.URLParams{Path: "your-property-id"}) // https://edgioapis.com/accounts/v0.1/properties/your-property-id

client.GetServiceURL Mandatory Params

Since this function inherits all its configuration from the created (by the client.New func) client, there are no mandatory parameters. All of them were already validated on the creation of the client.

client.GetServiceURL Optional Params & Default Values

back to the main README