rollbar

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT, MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AccessToken string
	Scheme      string
	Host        string
	BasePath    string
}

Client represents the rollbar client.

func NewClient

func NewClient(apiKey string, opts ...Option) (*Client, error)

NewClient is a constructor.

func (*Client) GetProjectAccessTokenByProjectIDAndName

func (c *Client) GetProjectAccessTokenByProjectIDAndName(projectID int, name string) (*ProjectAccessToken, error)

GetProjectAccessTokenByProjectIDAndName returns the first project access token from the list-projects-tokens call that matches a given name nad project id. If there is no matching project, return nil.

func (*Client) GetProjectByName

func (c *Client) GetProjectByName(name string) (*Project, error)

GetProjectByName returns the first project from the list-projects call that matches a given name. If there is no matching project returns nil.

func (*Client) GetUser

func (c *Client) GetUser(email string) (int, error)

GetUser fetches one user.

func (*Client) InviteUser

func (c *Client) InviteUser(teamID int, email string) (*InviteResponse, error)

InviteUser sends an invitation to a user.

func (*Client) ListInvites

func (c *Client) ListInvites(teamID int) ([]Invite, error)

ListInvites lists all the invites.

func (*Client) ListProjectAccessTokens

func (c *Client) ListProjectAccessTokens(projectID int) ([]*ProjectAccessToken, error)

ListProjectAccessTokens lists the projects access tokens for a given project id https://docs.rollbar.com/reference#list-all-project-access-tokens

func (*Client) ListProjects

func (c *Client) ListProjects() ([]*Project, error)

ListProjects lists the projects for this API Key https://docs.rollbar.com/reference#list-all-projects

func (*Client) ListUsers

func (c *Client) ListUsers() (*ListUsersResponse, error)

ListUsers : A function for listing the users.

func (*Client) RemoveUserTeam

func (c *Client) RemoveUserTeam(email string, teamID int) error

RemoveUserTeam removes a user from a team.

type Invite

type Invite struct {
	ID           int    `json:"id"`
	FromUserID   int    `json:"from_user_id"`
	TeamID       int    `json:"team_id"`
	ToEmail      string `json:"to_email"`
	Status       string `json:"status"`
	DateCreated  int    `json:"date_created"`
	DateRedeemed int    `json:"date_redeemed"`
}

Invite represents nested invites from the ListInvitesResponse.

type InviteResponse

type InviteResponse struct {
	Error  int `json:"err"`
	Result struct {
		ID           int    `json:"id"`
		FromUserID   int    `json:"from_user_id"`
		TeamID       int    `json:"team_id"`
		ToEmail      string `json:"to_email"`
		Status       string `json:"status"`
		DateCreated  int    `json:"date_created"`
		DateRedeemed int    `json:"date_redeemed"`
	}
}

InviteResponse represents the list invites response.

type ListInvitesResponse

type ListInvitesResponse struct {
	Error  int `json:"err"`
	Result []Invite
}

ListInvitesResponse represents the ListInvites response.

type ListUsersResponse

type ListUsersResponse struct {
	Error  int `json:"err"`
	Result struct {
		Users []struct {
			Username string `json:"username"`
			ID       int    `json:"id"`
			Email    string `json:"email"`
		}
	}
}

ListUsersResponse represents the list users response.

type Option

type Option func(*Client) error

Option adds the base url and other parameters to the client.

func BaseURL

func BaseURL(baseURL string) Option

BaseURL returns a function for configuring the url inside a Client.

type Project

type Project struct {
	AccountID    int    `json:"account_id"`
	ID           int    `json:"id"`
	DateCreated  int    `json:"date_created"`
	DateModified int    `json:"date_modified"`
	Name         string `json:"name"`
}

Project represents a project

type ProjectAccessToken

type ProjectAccessToken struct {
	ProjectID    int    `json:"project_id"`
	AccessToken  string `json:"access_token"`
	Name         string `json:"name"`
	Status       string `json:"status"`
	DateCreated  int    `json:"date_created"`
	DateModified int    `json:"date_modified"`
}

ProjectAccessToken represents a project access token

type VarsUsers

type VarsUsers struct {
	TeamID    int    `json:"TeamID"`
	UserID    int    `json:"UserID"`
	UserEmail string `json:"UserEmail"`
}

VarsUsers : A data structure for the mock response.

Jump to

Keyboard shortcuts

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