Documentation ¶
Index ¶
- func CheckResponse(r *http.Response) error
- type Client
- type Dashboard
- type DashboardAddWidget
- type DashboardList
- type DashboardNotFoundError
- type DashboardService
- func (s *DashboardService) AddWidget(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error)
- func (s *DashboardService) Create(projectName string, d *NewDashboard) (int, *Response, error)
- func (s *DashboardService) Delete(projectName string, id int) (string, *Response, error)
- func (s *DashboardService) GetByID(projectName string, id int) (*Dashboard, *Response, error)
- func (s *DashboardService) GetByName(projectName, name string) (*Dashboard, *Response, error)
- func (s *DashboardService) RemoveWidget(projectName string, dashboardID int, widgetID int) (string, *Response, error)
- func (s *DashboardService) Update(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error)
- type DashboardWidget
- type DashboardWidgetPosition
- type DashboardWidgetSize
- type EntryCreated
- type ErrorResponse
- type Filter
- type FilterCondition
- type FilterList
- type FilterNotFoundError
- type FilterOrder
- type FilterService
- func (s *FilterService) Create(projectName string, f *NewFilter) (int, *Response, error)
- func (s *FilterService) GetByID(projectName string, id int) (*Filter, *Response, error)
- func (s *FilterService) GetByName(projectName, name string) (*Filter, *Response, error)
- func (s *FilterService) Update(projectName string, id int, f *UpdateFilter) (string, *Response, error)
- type IDashboardService
- type IFilterService
- type IProjectSettingsService
- type IWidgetService
- type IssueSubType
- type IssueSubTypes
- type MockDashboardService
- func (s *MockDashboardService) AddWidget(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error)
- func (s *MockDashboardService) Create(projectName string, d *NewDashboard) (int, *Response, error)
- func (s *MockDashboardService) Delete(projectName string, id int) (string, *Response, error)
- func (s *MockDashboardService) GetByID(projectName string, id int) (*Dashboard, *Response, error)
- func (s *MockDashboardService) GetByName(projectName, name string) (*Dashboard, *Response, error)
- func (s *MockDashboardService) RemoveWidget(projectName string, dashboardID int, widgetID int) (string, *Response, error)
- func (s *MockDashboardService) Update(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error)
- type MockDashboardServiceCounter
- type MockFilterService
- func (s *MockFilterService) Create(projectName string, f *NewFilter) (int, *Response, error)
- func (s *MockFilterService) GetByID(projectName string, id int) (*Filter, *Response, error)
- func (s *MockFilterService) GetByName(projectName, name string) (*Filter, *Response, error)
- func (s *MockFilterService) Update(projectName string, id int, f *UpdateFilter) (string, *Response, error)
- type MockFilterServiceCounter
- type MockProjectSettingsService
- type MockProjectSettingsServiceCounter
- type MockWidgetService
- type MockWidgetServiceCounter
- type NewDashboard
- type NewFilter
- type NewWidget
- type OperationCompletion
- type ProjectSettings
- type ProjectSettingsService
- type Response
- type UpdateDashboard
- type UpdateFilter
- type Widget
- type WidgetContentParameters
- type WidgetService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range.
Types ¶
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public GitHub API, but can be // set to a domain endpoint to use with GitHub Enterprise. BaseURL should // always be specified with a trailing slash. BaseURL *url.URL // Services used for talking to different parts of the ReportPortal API. Dashboard IDashboardService Widget IWidgetService Filter IFilterService ProjectSettings IProjectSettingsService // contains filtered or unexported fields }
A Client manages communication with the ReportPortal API.
func (*Client) BareDo ¶
BareDo sends an API request and lets you handle the api response. If an error or API Error occurs, the error will contain more information. Otherwise you are supposed to read and close the response's Body.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If v is nil, and no error hapens, the response is returned as is.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type Dashboard ¶
type Dashboard struct { Owner string `json:"owner"` ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Widgets []DashboardWidget `json:"widgets"` }
type DashboardAddWidget ¶
type DashboardAddWidget struct {
AddWidget *DashboardWidget `json:"addWidget"`
}
type DashboardList ¶
type DashboardList struct {
Content []*Dashboard `json:"content"`
}
type DashboardNotFoundError ¶
type DashboardNotFoundError struct {
Message string
}
func NewDashboardNotFoundError ¶
func NewDashboardNotFoundError(projectName, dashboardName string) *DashboardNotFoundError
func (*DashboardNotFoundError) Error ¶
func (e *DashboardNotFoundError) Error() string
type DashboardService ¶
type DashboardService service
func (*DashboardService) AddWidget ¶
func (s *DashboardService) AddWidget(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error)
func (*DashboardService) Create ¶
func (s *DashboardService) Create(projectName string, d *NewDashboard) (int, *Response, error)
func (*DashboardService) GetByName ¶
func (s *DashboardService) GetByName(projectName, name string) (*Dashboard, *Response, error)
func (*DashboardService) RemoveWidget ¶ added in v0.3.0
func (*DashboardService) Update ¶ added in v0.3.0
func (s *DashboardService) Update(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error)
type DashboardWidget ¶
type DashboardWidget struct { WidgetID int `json:"widgetId"` WidgetName string `json:"widgetName"` WidgetType string `json:"widgetType"` WidgetSize DashboardWidgetSize `json:"widgetSize"` WidgetPosition DashboardWidgetPosition `json:"widgetPosition"` }
type DashboardWidgetPosition ¶
type DashboardWidgetSize ¶
type EntryCreated ¶
type EntryCreated struct {
ID int `json:"id"`
}
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error ErrorCode int `json:"errorCode"` // error code Message string `json:"message"` // error message ErrorDescription string `json:"error_description"` ErrorS string `json:"error"` }
An ErrorResponse reports one or more errors caused by an API request.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Filter ¶
type Filter struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` Owner string `json:"owner"` Conditions []FilterCondition `json:"conditions"` Orders []FilterOrder `json:"orders"` }
type FilterCondition ¶ added in v0.2.0
type FilterList ¶
type FilterList struct {
Content []*Filter `json:"content"`
}
type FilterNotFoundError ¶
type FilterNotFoundError struct {
Message string
}
func NewFilterNotFoundError ¶
func NewFilterNotFoundError(projectName, filterName string) *FilterNotFoundError
func (*FilterNotFoundError) Error ¶
func (e *FilterNotFoundError) Error() string
type FilterOrder ¶ added in v0.2.0
type FilterService ¶
type FilterService service
func (*FilterService) GetByName ¶
func (s *FilterService) GetByName(projectName, name string) (*Filter, *Response, error)
func (*FilterService) Update ¶ added in v0.3.0
func (s *FilterService) Update(projectName string, id int, f *UpdateFilter) (string, *Response, error)
type IDashboardService ¶ added in v0.3.0
type IDashboardService interface { GetByName(projectName, name string) (*Dashboard, *Response, error) GetByID(projectName string, id int) (*Dashboard, *Response, error) Create(projectName string, d *NewDashboard) (int, *Response, error) Update(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error) Delete(projectName string, id int) (string, *Response, error) AddWidget(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error) RemoveWidget(projectName string, dashboardID int, widgetID int) (string, *Response, error) }
type IFilterService ¶ added in v0.3.0
type IFilterService interface { GetByID(projectName string, id int) (*Filter, *Response, error) GetByName(projectName, name string) (*Filter, *Response, error) Create(projectName string, f *NewFilter) (int, *Response, error) Update(projectName string, id int, f *UpdateFilter) (string, *Response, error) }
type IProjectSettingsService ¶ added in v0.3.0
type IProjectSettingsService interface {
Get(projectName string) (*ProjectSettings, *Response, error)
}
type IWidgetService ¶ added in v0.3.0
type IssueSubType ¶
type IssueSubTypes ¶ added in v0.3.0
type IssueSubTypes map[string][]IssueSubType
type MockDashboardService ¶ added in v0.3.0
type MockDashboardService struct { GetByNameM func(projectName, name string) (*Dashboard, *Response, error) GetByIDM func(projectName string, id int) (*Dashboard, *Response, error) CreateM func(projectName string, d *NewDashboard) (int, *Response, error) UpdateM func(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error) DeleteM func(projectName string, id int) (string, *Response, error) AddWidgetM func(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error) RemoveWidgetM func(projectName string, dashboardID int, widgetID int) (string, *Response, error) Counter MockDashboardServiceCounter }
func (*MockDashboardService) AddWidget ¶ added in v0.3.0
func (s *MockDashboardService) AddWidget(projectName string, dashboardID int, w *DashboardWidget) (string, *Response, error)
func (*MockDashboardService) Create ¶ added in v0.3.0
func (s *MockDashboardService) Create(projectName string, d *NewDashboard) (int, *Response, error)
func (*MockDashboardService) GetByName ¶ added in v0.3.0
func (s *MockDashboardService) GetByName(projectName, name string) (*Dashboard, *Response, error)
func (*MockDashboardService) RemoveWidget ¶ added in v0.3.0
func (*MockDashboardService) Update ¶ added in v0.3.0
func (s *MockDashboardService) Update(projectName string, dashboardID int, d *UpdateDashboard) (string, *Response, error)
type MockDashboardServiceCounter ¶ added in v0.3.0
type MockFilterService ¶ added in v0.3.0
type MockFilterService struct { GetByIDM func(projectName string, id int) (*Filter, *Response, error) GetByNameM func(projectName, name string) (*Filter, *Response, error) CreateM func(projectName string, f *NewFilter) (int, *Response, error) UpdateM func(projectName string, id int, f *UpdateFilter) (string, *Response, error) Counter MockFilterServiceCounter }
func (*MockFilterService) GetByName ¶ added in v0.3.0
func (s *MockFilterService) GetByName(projectName, name string) (*Filter, *Response, error)
func (*MockFilterService) Update ¶ added in v0.3.0
func (s *MockFilterService) Update(projectName string, id int, f *UpdateFilter) (string, *Response, error)
type MockFilterServiceCounter ¶ added in v0.3.0
type MockProjectSettingsService ¶ added in v0.3.0
type MockProjectSettingsService struct { GetM func(projectName string) (*ProjectSettings, *Response, error) Counter MockProjectSettingsServiceCounter }
func (*MockProjectSettingsService) Get ¶ added in v0.3.0
func (s *MockProjectSettingsService) Get(projectName string) (*ProjectSettings, *Response, error)
type MockProjectSettingsServiceCounter ¶ added in v0.3.0
type MockProjectSettingsServiceCounter struct {
Get int
}
type MockWidgetService ¶ added in v0.3.0
type MockWidgetService struct { GetM func(projectName string, id int) (*Widget, *Response, error) PostM func(projectName string, w *NewWidget) (int, *Response, error) Counter MockWidgetServiceCounter }
type MockWidgetServiceCounter ¶ added in v0.3.0
type NewDashboard ¶
type NewFilter ¶ added in v0.2.0
type NewFilter struct { Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` Conditions []FilterCondition `json:"conditions"` Orders []FilterOrder `json:"orders"` }
type NewWidget ¶
type NewWidget struct { Name string `json:"name"` Description string `json:"description"` WidgetType string `json:"widgetType"` ContentParameters WidgetContentParameters `json:"contentParameters"` Filters []int `json:"filterIds"` }
type OperationCompletion ¶
type OperationCompletion struct {
Message string `json:"message"`
}
type ProjectSettings ¶
type ProjectSettings struct { ProjectID int `json:"project"` SubTypes IssueSubTypes `json:"subTypes"` }
type ProjectSettingsService ¶
type ProjectSettingsService service
func (*ProjectSettingsService) Get ¶
func (s *ProjectSettingsService) Get(projectName string) (*ProjectSettings, *Response, error)
type UpdateDashboard ¶ added in v0.3.0
type UpdateFilter ¶ added in v0.3.0
type UpdateFilter struct { Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` Conditions []FilterCondition `json:"conditions"` Orders []FilterOrder `json:"orders"` }
type Widget ¶
type Widget struct { Description string `json:"description"` Owner string `json:"owner"` ID int `json:"id"` Name string `json:"name"` WidgetType string `json:"widgetType"` ContentParameters WidgetContentParameters `json:"contentParameters"` AppliedFilters []Filter `json:"appliedFilters"` Content interface{} `json:"content"` // incomplete }