region

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package region describes the operational regions defined for New Relic

Regions are geographical locations where the New Relic platform operates and this package provides an abstraction layer for handling them within the New Relic Client and underlying APIs

Index

Constants

This section is empty.

Variables

View Source
var Regions = map[Name]*Region{
	US: {
		// contains filtered or unexported fields
	},
	EU: {
		// contains filtered or unexported fields
	},
	Staging: {
		// contains filtered or unexported fields
	},
}

Functions

This section is empty.

Types

type InvalidError

type InvalidError struct {
	Message string
}

InvalidError returns when the Region is not valid

func ErrorNil

func ErrorNil() InvalidError

ErrorNil returns an InvalidError message saying the value was nil

func (InvalidError) Error

func (e InvalidError) Error() string

Error string reported when an InvalidError happens

type Name

type Name string

Name is the name of a New Relic region

const (
	// US represents New Relic's US-based production deployment.
	US Name = "US"

	// EU represents New Relic's EU-based production deployment.
	EU Name = "EU"

	// Staging represents New Relic's US-based staging deployment.
	// This is for internal New Relic use only.
	Staging Name = "Staging"
)

type Region

type Region struct {
	// contains filtered or unexported fields
}

Region represents the members of the Region enumeration.

var Default *Region = Regions[US]

Default represents the region returned if nothing was specified

func Parse

func Parse(r string) *Region

Parse takes a Region string and returns a RegionType

func (*Region) InfrastructureURL

func (r *Region) InfrastructureURL(path ...string) string

InfrastructureURL returns the Full URL for Infrastructure REST API Calls, with any additional path elements appended

func (*Region) NerdGraphURL

func (r *Region) NerdGraphURL(path ...string) string

NerdGraphURL returns the Full URL for Infrastructure REST API Calls, with any additional path elements appended

func (*Region) RestURL

func (r *Region) RestURL(path ...string) string

RestURL returns the Full URL for REST API Calls, with any additional path elements appended

func (*Region) SetInfrastructureBaseURL

func (r *Region) SetInfrastructureBaseURL(url string)

SetInfrastructureBaseURL Allows overriding the Infrastructure Base URL

func (*Region) SetNerdGraphBaseURL

func (r *Region) SetNerdGraphBaseURL(url string)

SetNerdGraphBaseURL Allows overriding the NerdGraph Base URL

func (*Region) SetRestBaseURL

func (r *Region) SetRestBaseURL(url string)

SetRestBaseURL Allows overriding the REST Base URL

func (*Region) SetSyntheticsBaseURL

func (r *Region) SetSyntheticsBaseURL(url string)

SetSyntheticsBaseURL Allows overriding the Synthetics Base URL

func (*Region) String

func (r *Region) String() string

String returns a human readable value for the specified Region

func (*Region) SyntheticsURL

func (r *Region) SyntheticsURL(path ...string) string

SyntheticsURL returns the Full URL for Infrastructure REST API Calls, with any additional path elements appended

Jump to

Keyboard shortcuts

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