rpdac

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFieldsSubTypes

func DecodeFieldsSubTypes(fields []string, decodeMap map[string]string) ([]string, error)

convert 'statistics$defects$system_issue$xx_xxxxxxxxxxx' fields to 'statistics$defects$system_issue$shortname`

func EncodeFieldsSubTypes

func EncodeFieldsSubTypes(fields []string, encodeMap map[string]string) ([]string, error)

convert 'statistics$defects$system_issue$shortname' fields to 'statistics$defects$system_issue$xx_xxxxxxxxxxx'

func FilterToNewFilter added in v0.3.0

func FilterToNewFilter(f *Filter) *reportportal.NewFilter

func FilterToUpdateFilter added in v0.3.0

func FilterToUpdateFilter(f *Filter) *reportportal.UpdateFilter

func FromWidget

func FromWidget(dashboardHash string, w *Widget, filtersMap map[string]int, encodeSubTypesMap map[string]string) (*reportportal.NewWidget, *reportportal.DashboardWidget, error)

func HashName added in v0.3.0

func HashName(name string) string

Types

type Dashboard

type Dashboard struct {
	Kind        ObjectKind `json:"kind"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Widgets     []*Widget  `json:"widgets"`
	// contains filtered or unexported fields
}

func ToDashboard

func ToDashboard(d *reportportal.Dashboard, widgets []*Widget) *Dashboard

func (*Dashboard) Equals added in v0.3.0

func (left *Dashboard) Equals(right Object) bool

Compare the two Dashboards ignoring slices order

func (*Dashboard) GetKind added in v0.2.0

func (d *Dashboard) GetKind() ObjectKind

func (*Dashboard) GetName added in v0.2.0

func (d *Dashboard) GetName() string

func (*Dashboard) HashName

func (d *Dashboard) HashName() string

type DashboardService added in v0.3.0

type DashboardService service

func (*DashboardService) Create added in v0.3.0

func (s *DashboardService) Create(project string, o Object) error

func (*DashboardService) Delete added in v0.3.0

func (s *DashboardService) Delete(project, name string) error

Delete the Dashboard with the given name and Widgets created for it

func (*DashboardService) Get added in v0.3.0

func (s *DashboardService) Get(project string, id int) (Object, error)

func (*DashboardService) GetByName added in v0.3.0

func (s *DashboardService) GetByName(project, name string) (Object, error)

func (*DashboardService) Update added in v0.3.0

func (s *DashboardService) Update(project string, current, target Object) error

type Filter added in v0.2.0

type Filter struct {
	Kind        ObjectKind        `json:"kind"`
	Name        string            `json:"name"`
	Type        string            `json:"type"`
	Description string            `json:"description"`
	Conditions  []FilterCondition `json:"conditions"`
	Orders      []FilterOrder     `json:"orders"`
	// contains filtered or unexported fields
}

func LoadFilterFromFile added in v0.2.0

func LoadFilterFromFile(file []byte) (*Filter, error)

func ToFilter added in v0.2.0

func ToFilter(f *reportportal.Filter) *Filter

func (*Filter) Equals added in v0.3.0

func (left *Filter) Equals(right Object) bool

func (*Filter) GetKind added in v0.2.0

func (f *Filter) GetKind() ObjectKind

func (*Filter) GetName added in v0.2.0

func (f *Filter) GetName() string

type FilterCondition added in v0.2.0

type FilterCondition struct {
	FilteringField string `json:"filteringField"`
	Condition      string `json:"condition"`
	Value          string `json:"value"`
}

type FilterOrder added in v0.2.0

type FilterOrder struct {
	SortingColumn string `json:"sortingColumn"`
	IsAsc         bool   `json:"isAsc"`
}

type FilterService added in v0.3.0

type FilterService service

func (*FilterService) Create added in v0.3.0

func (s *FilterService) Create(project string, o Object) error

func (*FilterService) Delete added in v0.3.0

func (s *FilterService) Delete(project, name string) error

func (*FilterService) Get added in v0.3.0

func (s *FilterService) Get(project string, id int) (Object, error)

func (*FilterService) GetByName added in v0.3.0

func (s *FilterService) GetByName(project, name string) (Object, error)

func (*FilterService) Update added in v0.3.0

func (s *FilterService) Update(project string, current, target Object) error

type GenericObject added in v0.2.0

type GenericObject struct {
	Kind ObjectKind `json:"kind"`
	Name string     `json:"name"`
}

type MockObject added in v0.3.0

type MockObject struct {
	Kind ObjectKind
	Name string

	Counter MockObjectCounter
}

func (*MockObject) Equals added in v0.3.0

func (m *MockObject) Equals(o Object) bool

func (*MockObject) GetKind added in v0.3.0

func (m *MockObject) GetKind() ObjectKind

func (*MockObject) GetName added in v0.3.0

func (m *MockObject) GetName() string

type MockObjectCounter added in v0.3.0

type MockObjectCounter struct {
	Equals int
}

type MockService added in v0.3.0

type MockService struct {
	GetM       func(project string, id int) (Object, error)
	GetByNameM func(project, name string) (Object, error)
	CreateM    func(project string, o Object) error
	UpdateM    func(project string, current Object, target Object) error
	DeleteM    func(project, name string) error

	Counter MockServiceCounter
}

func (*MockService) Create added in v0.3.0

func (s *MockService) Create(project string, o Object) error

func (*MockService) Delete added in v0.3.0

func (s *MockService) Delete(project, name string) error

func (*MockService) Get added in v0.3.0

func (s *MockService) Get(project string, id int) (Object, error)

func (*MockService) GetByName added in v0.3.0

func (s *MockService) GetByName(project, name string) (Object, error)

func (*MockService) Update added in v0.3.0

func (s *MockService) Update(project string, current Object, target Object) error

type MockServiceCounter added in v0.3.0

type MockServiceCounter struct {
	Get       int
	GetByName int
	Create    int
	Update    int
	Delete    int
}

type Object added in v0.2.0

type Object interface {
	GetName() string
	GetKind() ObjectKind
	Equals(o Object) bool
}

func UnmarshalObject added in v0.3.0

func UnmarshalObject(file []byte) (Object, error)

type ObjectKind added in v0.3.0

type ObjectKind int
const (
	UnknownKind ObjectKind = iota
	DashboardKind
	FilterKind
)

func (ObjectKind) MarshalJSON added in v0.3.0

func (k ObjectKind) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (ObjectKind) MarshalYAML added in v0.3.0

func (k ObjectKind) MarshalYAML() (interface{}, error)

func (ObjectKind) String added in v0.3.0

func (k ObjectKind) String() string

func (*ObjectKind) UnmarshalJSON added in v0.3.0

func (k *ObjectKind) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

func (*ObjectKind) UnmarshalYAML added in v0.3.0

func (k *ObjectKind) UnmarshalYAML(unmarshal func(interface{}) error) error

type ReportPortal

type ReportPortal struct {
	Dashboard ServiceInterface
	Filter    ServiceInterface
	// contains filtered or unexported fields
}

func NewReportPortal

func NewReportPortal(c *reportportal.Client) *ReportPortal

func (*ReportPortal) Apply added in v0.3.0

func (r *ReportPortal) Apply(project, file string, recursive bool) error

func (*ReportPortal) ApplyFile added in v0.3.0

func (r *ReportPortal) ApplyFile(project, file string) error

func (*ReportPortal) ApplyObject added in v0.3.0

func (r *ReportPortal) ApplyObject(project string, o Object) error

func (*ReportPortal) Create added in v0.3.0

func (r *ReportPortal) Create(project, file string) error

Create a object/resource in ReportPortal from the passed file.

func (*ReportPortal) Export added in v0.3.0

func (r *ReportPortal) Export(k ObjectKind, project string, id int, name string, file string) error

Export the ObjectKind with the passed id or name from the passed project to the passed file.

The file can be a relative or absoulte path to the file that will be written with the full content of the exported Object.

func (*ReportPortal) Service added in v0.3.0

func (r *ReportPortal) Service(kind ObjectKind) (ServiceInterface, error)

type ServiceInterface added in v0.3.0

type ServiceInterface interface {
	Get(project string, id int) (Object, error)
	GetByName(project, name string) (Object, error)
	Create(project string, o Object) error
	Update(project string, current Object, target Object) error
	Delete(project, name string) error
}

type Widget

type Widget struct {
	Name              string                  `json:"name"`
	Description       string                  `json:"description"`
	WidgetType        string                  `json:"widgetType"`
	WidgetSize        WidgetSize              `json:"widgetSize"`
	WidgetPosition    WidgetPosition          `json:"widgetPosition"`
	Filters           []string                `json:"filters"`
	ContentParameters WidgetContentParameters `json:"contentParameters"`
	// contains filtered or unexported fields
}

func ToWidget

func ToWidget(w *reportportal.Widget, dw *reportportal.DashboardWidget, dashboardHash string, decodeSubTypesMap map[string]string) (*Widget, error)

type WidgetContentParameters

type WidgetContentParameters struct {
	ContentFields []string               `json:"contentFields"`
	ItemsCount    int                    `json:"itemsCount"`
	WidgetOptions map[string]interface{} `json:"widgetOptions"`
}

type WidgetPosition

type WidgetPosition struct {
	PositionX int `json:"positionX"`
	PositionY int `json:"positionY"`
}

type WidgetSize

type WidgetSize struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

Jump to

Keyboard shortcuts

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