Documentation ¶
Overview ¶
Package users provides a programmatic API for interacting with New Relic users. It can be used to retrieve details about the user.
Authentication ¶
You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key:
https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys
Code generated by tutone: DO NOT EDIT
Package users provides a programmatic API for interacting with New Relic users.
Code generated by tutone: DO NOT EDIT
Example (Accounts) ¶
// Initialize the client configuration. A Personal API key is required to // communicate with the backend API. cfg := config.New() cfg.PersonalAPIKey = os.Getenv("NEW_RELIC_API_KEY") // Initialize the client. client := New(cfg) user, err := client.GetUser() if err != nil { log.Fatal("error retrieving user:", err) } log.Printf("User name: %s", user.Name) log.Printf("User email: %s", user.Email) log.Printf("User ID: %d", user.ID)
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { // The `User` that is associated with the API key used in this request. User User `json:"user,omitempty"` }
Actor - The `Actor` object contains fields that are scoped to the API user's access level.
type User ¶
type User struct { // Email string `json:"email,omitempty"` // ID int `json:"id,omitempty"` // Name string `json:"name,omitempty"` }
User - The `User` object provides general data about the user.
type UserReference ¶
type UserReference struct { // Email string `json:"email,omitempty"` // Gravatar string `json:"gravatar,omitempty"` // ID int `json:"id,omitempty"` // Name string `json:"name,omitempty"` }
UserReference - The `UserReference` object provides basic identifying information about the user.