Documentation ¶
Index ¶
- Constants
- func Convert(from interface{}, to interface{}) error
- func NewErrorAttemptDeleteActiveUser(user string) error
- func NewNetworkError(cause error) error
- func RandString(n int) string
- func ToJsonNoEscape(t interface{}) ([]byte, error)
- type ActiveUser
- type ActiveUserList
- type ActiveUserService
- type Client
- type ClientConfig
- type ClientError
- type GraphQLRequest
- type GraphQLResponse
- type Invitation
- type InvitationList
- type InvitationService
- type OrganizationMember
- type OrganizationWithInvitations
- type OrganizationWithMembers
- type Product
- type UpdateActiveUserRequest
- type User
- type UserService
Constants ¶
const ( ErrCodeNetworkException uint32 = iota ErrCodeDeleteActiveUserException )
const ( EnvSolarwindsUser = "SOLARWINDS_USER" EnvSolarwindsPassword = "SOLARWINDS_PASSWD" EnvSolarwindsOrganizationId = "SOLARWINDS_ORG_ID" )
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(from interface{}, to interface{}) error
Convert is typically used to convert map[string]interface{} to a struct in the same json structure.
func NewNetworkError ¶
func RandString ¶
RandString returns random string at specified length.
func ToJsonNoEscape ¶
Note there will be a new line character at the end of the output.
Types ¶
type ActiveUser ¶
type ActiveUserList ¶
type ActiveUserList struct { OwnerUserId string `json:"id"` Organization OrganizationWithMembers `json:"currentOrganization"` }
type ActiveUserService ¶
type ActiveUserService struct {
// contains filtered or unexported fields
}
func (*ActiveUserService) Get ¶
func (us *ActiveUserService) Get(userId string) (*ActiveUserList, error)
func (*ActiveUserService) GetByEmail ¶
func (us *ActiveUserService) GetByEmail(email string) (*OrganizationMember, error)
func (*ActiveUserService) List ¶
func (us *ActiveUserService) List() (*ActiveUserList, error)
func (*ActiveUserService) Update ¶
func (us *ActiveUserService) Update(update UpdateActiveUserRequest) error
type Client ¶
type Client struct { InvitationService *InvitationService ActiveUserService *ActiveUserService UserService *UserService // contains filtered or unexported fields }
func NewClient ¶
func NewClient(config ClientConfig) (*Client, error)
Does not involve any network interactions.
func (*Client) MakeGraphQLRequest ¶
func (c *Client) MakeGraphQLRequest(graphQLRequest *GraphQLRequest) (*GraphQLResponse, error)
type ClientConfig ¶
type ClientError ¶
func (*ClientError) Error ¶
func (c *ClientError) Error() string
type GraphQLRequest ¶
type GraphQLResponse ¶
type GraphQLResponse map[string]interface{}
func NewGraphQLResponse ¶
func NewGraphQLResponse(body io.Reader, key string) (*GraphQLResponse, error)
type Invitation ¶
type InvitationList ¶
type InvitationList struct { OwnerUserId string `json:"id"` Organization OrganizationWithInvitations `json:"currentOrganization"` }
type InvitationService ¶
type InvitationService struct {
// contains filtered or unexported fields
}
func (*InvitationService) Create ¶
func (is *InvitationService) Create(user Invitation) error
func (*InvitationService) List ¶
func (is *InvitationService) List() (*InvitationList, error)
func (*InvitationService) Resend ¶
func (is *InvitationService) Resend(email string) error
func (*InvitationService) Revoke ¶
func (is *InvitationService) Revoke(email string) error
type OrganizationMember ¶
type OrganizationMember struct { User ActiveUser `json:"user"` Role string `json:"role"` Products []Product `json:"products"` }
type OrganizationWithInvitations ¶
type OrganizationWithInvitations struct { Id string `json:"id"` Invitations []Invitation `json:"invitations"` }
type OrganizationWithMembers ¶
type OrganizationWithMembers struct { Id string `json:"id"` Members []OrganizationMember `json:"members"` }
type UpdateActiveUserRequest ¶
type User ¶
type User = Invitation
type UserService ¶
type UserService struct { ActiveUserService *ActiveUserService InvitationService *InvitationService }
func (*UserService) Create ¶
func (us *UserService) Create(user User) error
Create will create a new invitation for the user. It is not possible to add user without going through invitation.
func (*UserService) Delete ¶
func (us *UserService) Delete(email string) error
Delete will only be effective if it is an invitation. There is no way to delete an active user in Pingdom.
func (*UserService) Retrieve ¶
func (us *UserService) Retrieve(email string) (*User, error)
Retrieve return the user information, either it is an invitation or an active user.
func (*UserService) Update ¶
func (us *UserService) Update(update User) error
Update will first try to update an active user with the given email. If no such user exist, will see if there is an invitation with the email, if yes, will revoke the invitation and send a new one. Otherwise, error is returned.