region

package
v0.55.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 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
	},
	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 added in v0.21.0

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 added in v0.21.0

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) InsightsURL added in v0.26.0

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

InsightsURL returns the Full URL for Insights custom insert API calls

func (*Region) LogsURL added in v0.38.0

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 added in v0.26.0

func (r *Region) SetInsightsBaseURL(url string)

func (*Region) SetLogsBaseURL added in v0.38.0

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 added in v0.21.0

type UnknownError struct {
	Message string
}

func (UnknownError) Error added in v0.21.0

func (e UnknownError) Error() string

type UnknownUsingDefaultError added in v0.21.0

type UnknownUsingDefaultError struct {
	Message string
}

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

func (UnknownUsingDefaultError) Error added in v0.21.0

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