region

package
v2.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

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
	},
	Local: {
		// contains filtered or unexported fields
	},
}

Regions defines the service URLs that make up the various environments.

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"

	// Local represents a local development environment.
	Local Name = "Local"
)
const Default Name = US

Default represents the region returned if nothing was specified

func Parse

func Parse(r string) (Name, error)

Parse takes a Region string and returns a RegionType

func (Name) String

func (n Name) String() string

String returns a human readable value for the specified Region Name

type Region

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

Region represents the members of the Region enumeration.

func Get

func Get(r Name) (*Region, error)

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) InsightsKeysURL

func (r *Region) InsightsKeysURL(accountID int, path string) string

InsightsURL returns the Full URL for Insights custom insert API calls

func (*Region) InsightsURL

func (r *Region) InsightsURL(accountID int) string

InsightsURL returns the Full URL for Insights custom insert API calls

func (*Region) LogsURL

func (r *Region) LogsURL() string

LogsURL returns the Full URL for the Log API

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) SetInsightsBaseURL

func (r *Region) SetInsightsBaseURL(url string)

func (*Region) SetInsightsKeysBaseURL

func (r *Region) SetInsightsKeysBaseURL(url string)

func (*Region) SetLogsBaseURL

func (r *Region) SetLogsBaseURL(url string)

SetLogsBaseURL Allows overriding the Logs 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 Synthetics REST API Calls, with any additional path elements appended

type UnknownError

type UnknownError struct {
	Message string
}

func (UnknownError) Error

func (e UnknownError) Error() string

type UnknownUsingDefaultError

type UnknownUsingDefaultError struct {
	Message string
}

UnknownUsingDefaultError returns when the Region requested is not valid, but we want to give them something

func (UnknownUsingDefaultError) Error

func (e UnknownUsingDefaultError) Error() string

Error string reported when an InvalidError happens

Jump to

Keyboard shortcuts

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