Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAPIURL(baseURL, apiPath string, id, limit, offset int, qry url.Values) string
- func BuildFuncRespSavePages(dir string, projectID uint) func(qry url.Values, respBody []byte) error
- func ProcessCaseAPIResponse(r *http.Response, fn func(b []byte) error) (string, []byte, error)
- type Case
- type CaseAPI
- func (api CaseAPI) GetCaseSetAllFunc(ctx context.Context, projectID uint, qry url.Values, ...) (*CaseSet, error)
- func (api CaseAPI) GetCaseSetSectionsFunc(ctx context.Context, projectID uint, sectionIDs []uint, ...) error
- func (api CaseAPI) GetCases(ctx context.Context, projectID, limit, offset int, qry url.Values, ...) (*GetCasesResponse, []byte, *http.Response, error)
- func (api CaseAPI) GetWriteFileCaseSetAll(ctx context.Context, filename string, perm os.FileMode, prefix, indent string, ...) (*CaseSet, error)
- type CaseField
- type CaseFieldAPI
- type CaseFieldConfig
- type CaseFieldConfigOptions
- type CaseFieldContext
- type CaseFieldSet
- type CaseFields
- type CaseSet
- func (set *CaseSet) Add(c ...Case)
- func (set *CaseSet) FilterByFunc(fn FuncCaseMatch) *CaseSet
- func (set *CaseSet) Get(caseID uint) (Case, bool)
- func (set *CaseSet) IDs() []uint
- func (set *CaseSet) IDsByFunc(fn FuncCaseMatch) []uint
- func (set *CaseSet) IDsBySection(sectionID uint) []uint
- func (set *CaseSet) Len() uint
- func (set *CaseSet) LineageStringsHistogram(sectionSet *SectionSet, strSep string) (*histogram.Histogram, error)
- func (set *CaseSet) ReadDirJSONRawAPIs(dir string, rx *regexp.Regexp) error
- func (set *CaseSet) ReadFileJSON(filename string) error
- func (set *CaseSet) ReadFileJSONRawAPI(filename string) error
- func (set *CaseSet) ReadFileJSONRawAPIs(filenames ...string) error
- func (set *CaseSet) ReadFileJSONs(filenames ...string) error
- func (set *CaseSet) WriteFileJSON(filename string, perm os.FileMode, prefix, indent string) error
- type CaseType
- type CaseTypeAPI
- type CaseTypeSet
- type Client
- type FuncCaseMatch
- type GetCasesResponse
- type GetSectionsResponse
- type Links
- type Metadata
- type Metadatas
- type MultiSet
- type ResponsePagination
- type Section
- type SectionAPI
- type SectionSet
- func (set *SectionSet) Add(sections ...Section)
- func (set *SectionSet) BuildLineage(leafID uint) Metadatas
- func (set *SectionSet) GetByName(name string, depth int) []Section
- func (set *SectionSet) GetChildren(id uint) []Section
- func (set *SectionSet) GetChildrenIDsFlat(id uint, recurse bool) ([]uint, error)
- func (set *SectionSet) IDs() []uint
- func (set *SectionSet) Inflate() error
- func (set *SectionSet) Len() uint
- func (set *SectionSet) LineageIDsStringToNames(lin, sep string) (string, error)
- func (set *SectionSet) ReadFileJSON(filename string) error
- func (set *SectionSet) WriteFileJSON(filename string, perm os.FileMode, prefix, indent string) error
Constants ¶
View Source
const ( IndexPath = "index.php?" APIPathCasesGet = "/api/v2/get_cases/" APIPathCasesGetProjectID = "/api/v2/get_cases/%d&limit=%d&offset=%d" APIPathCaseFieldsGet = "/api/v2/get_case_fields/" APIPathCaseTypesGet = "/api/v2/get_case_types/" APIPathSectionsGet = "/api/v2/get_sections/" APIPathSectionsGetProjectID = "/api/v2/get_sections/%d&limit=%d&offset=%d" LimitMax uint = 250 QueryParamLimit = "limit" QueryParamOffset = "offset" QueryParamSectionID = "section_id" QueryParamSuiteID = "suite_id" SlugCase = "case" SlugCaseType = "case_type" SlugSection = "section" )
Variables ¶
View Source
var ErrResponseCannotBeNil = errors.New("response cannot be nil")
Functions ¶
func BuildAPIURL ¶
func BuildFuncRespSavePages ¶ added in v0.5.0
Types ¶
type Case ¶
type Case struct { ID uint `json:"id"` Title string `json:"title"` CreatedBy uint `json:"created_by"` CreatedOn uint `json:"created_on"` CustomAutomationType *int `json:"custom_automation_type"` DisplayOrder *int `json:"display_order"` Estimate *string `json:"estimate"` EstimateForecast *string `json:"estimate_forecast"` UpdatedBy uint `json:"updated_by"` UpdatedOn uint `json:"updated_on"` IsDeleted *int `json:"is_deleted"` MilestoneID *uint `json:"milestone_id"` PriorityID *uint `json:"priority_id"` Refs *string `json:"refs"` SectionID *uint `json:"section_id"` SuiteID *uint `json:"suite_id"` TemplateID *uint `json:"template_id"` TypeID *uint `json:"type_id"` XLineageSectionIDs string `json:"x_lineage_section_ids"` }
func (Case) MatchFunc ¶
func (c Case) MatchFunc(fn FuncCaseMatch) bool
func (Case) RefsContains ¶
type CaseAPI ¶ added in v0.2.0
type CaseAPI struct {
// contains filtered or unexported fields
}
func NewCaseAPI ¶ added in v0.2.0
func (CaseAPI) GetCaseSetAllFunc ¶ added in v0.5.0
func (CaseAPI) GetCaseSetSectionsFunc ¶ added in v0.5.0
type CaseFieldAPI ¶ added in v0.5.0
type CaseFieldAPI struct {
// contains filtered or unexported fields
}
func NewCaseFieldAPI ¶ added in v0.5.0
func NewCaseFieldAPI(client *Client) CaseFieldAPI
func (CaseFieldAPI) GetCaseFields ¶ added in v0.5.0
func (api CaseFieldAPI) GetCaseFields(ctx context.Context) (CaseFields, *http.Response, error)
type CaseFieldConfig ¶ added in v0.5.0
type CaseFieldConfig struct { Context CaseFieldContext `json:"context"` ID string `json:"id"` Options CaseFieldConfigOptions `json:"options"` }
type CaseFieldConfigOptions ¶ added in v0.5.0
type CaseFieldContext ¶ added in v0.5.0
type CaseFieldSet ¶ added in v0.5.0
type CaseFields ¶ added in v0.5.0
type CaseFields []CaseField
func ReadCaseFields ¶ added in v0.5.0
func ReadCaseFields(b []byte) (CaseFields, error)
func ReadFileCaseFields ¶ added in v0.5.0
func ReadFileCaseFields(filename string) (CaseFields, error)
type CaseSet ¶
func NewCaseSet ¶
func NewCaseSet() *CaseSet
func ReadFileCaseSet ¶
func (*CaseSet) FilterByFunc ¶
func (set *CaseSet) FilterByFunc(fn FuncCaseMatch) *CaseSet
func (*CaseSet) IDsByFunc ¶
func (set *CaseSet) IDsByFunc(fn FuncCaseMatch) []uint
func (*CaseSet) IDsBySection ¶
func (*CaseSet) LineageStringsHistogram ¶ added in v0.5.0
func (*CaseSet) ReadDirJSONRawAPIs ¶ added in v0.5.0
func (*CaseSet) ReadFileJSON ¶ added in v0.3.0
func (*CaseSet) ReadFileJSONRawAPI ¶ added in v0.5.0
func (*CaseSet) ReadFileJSONRawAPIs ¶ added in v0.5.0
func (*CaseSet) ReadFileJSONs ¶ added in v0.5.0
type CaseTypeAPI ¶ added in v0.2.0
type CaseTypeAPI struct {
// contains filtered or unexported fields
}
func NewCaseTypeAPI ¶ added in v0.2.0
func NewCaseTypeAPI(client *Client) CaseTypeAPI
func (CaseTypeAPI) GetCaseTypes ¶ added in v0.2.0
type CaseTypeSet ¶
func NewCaseTypeSet ¶ added in v0.3.0
func NewCaseTypeSet() *CaseTypeSet
func ReadFileCaseTypeSet ¶ added in v0.3.0
func ReadFileCaseTypeSet(filename string) (*CaseTypeSet, error)
func (*CaseTypeSet) Add ¶
func (set *CaseTypeSet) Add(items ...CaseType)
func (*CaseTypeSet) ReadFileJSON ¶ added in v0.3.0
func (set *CaseTypeSet) ReadFileJSON(filename string) error
type Client ¶
type Client struct { CaseAPI CaseAPI CaseTypeAPI CaseTypeAPI SectionAPI SectionAPI // contains filtered or unexported fields }
func NewClientFromGoauthCredentials ¶ added in v0.4.0
func NewClientFromGoauthCredentials(creds goauth.Credentials) (*Client, error)
type FuncCaseMatch ¶
type GetCasesResponse ¶
type GetCasesResponse struct { Offset uint `json:"offset"` Limit uint `json:"limit"` Size uint `json:"size"` Links Links `json:"_links"` Cases []Case `json:"cases"` }
func ReadFileAPIResponseGetCases ¶ added in v0.5.0
func ReadFileAPIResponseGetCases(filename string) (*GetCasesResponse, error)
type GetSectionsResponse ¶
type Metadatas ¶
type Metadatas []Metadata
func (Metadatas) LineageIDsString ¶ added in v0.5.0
func (Metadatas) LineageIDsStrings ¶ added in v0.5.0
type MultiSet ¶
type MultiSet struct { CaseSet *CaseSet `json:"cases"` CaseTypeSet *CaseTypeSet `json:"caseTypes"` SectionSet *SectionSet `json:"sections"` }
func NewMultiSet ¶ added in v0.3.0
func NewMultiSet() *MultiSet
type ResponsePagination ¶ added in v0.5.0
ResponsePagination is a container for pagination when only pagination parsing is needed.
func ParseResponsePaginationFromBody ¶ added in v0.5.0
func ParseResponsePaginationFromBody(r io.Reader) (ResponsePagination, []byte, error)
func ParseResponsePaginationFromRaw ¶ added in v0.5.0
func ParseResponsePaginationFromRaw(b []byte) (ResponsePagination, error)
type Section ¶
type Section struct { ID uint `json:"id"` SuiteID uint `json:"suite_id"` Name string `json:"name"` Description *string `json:"description"` ParentID *uint `json:"parent_id"` DisplayOrder uint `json:"display_order"` Depth uint `json:"depth"` ChildIDs []uint `json:"child_ids"` // not in API Lineage Metadatas `json:"lineage"` }
type SectionAPI ¶ added in v0.2.0
type SectionAPI struct {
// contains filtered or unexported fields
}
func NewSectionAPI ¶ added in v0.2.0
func NewSectionAPI(client *Client) SectionAPI
func (SectionAPI) GetSectionSetAll ¶ added in v0.4.0
func (api SectionAPI) GetSectionSetAll(ctx context.Context, projectID uint, qry url.Values) (*SectionSet, error)
func (SectionAPI) GetSections ¶ added in v0.2.0
func (api SectionAPI) GetSections(ctx context.Context, projectID, limit, offset uint, qry url.Values) (*GetSectionsResponse, *http.Response, error)
type SectionSet ¶
func NewSectionSet ¶
func NewSectionSet() *SectionSet
func ReadFileSectionSet ¶
func ReadFileSectionSet(filename string) (*SectionSet, error)
func (*SectionSet) Add ¶
func (set *SectionSet) Add(sections ...Section)
func (*SectionSet) BuildLineage ¶ added in v0.5.0
func (set *SectionSet) BuildLineage(leafID uint) Metadatas
func (*SectionSet) GetChildren ¶
func (set *SectionSet) GetChildren(id uint) []Section
func (*SectionSet) GetChildrenIDsFlat ¶
func (set *SectionSet) GetChildrenIDsFlat(id uint, recurse bool) ([]uint, error)
GetChildrenIDsFlat returns a list of sectionIDs in flat sorted order, e.g. not depth first order.
func (*SectionSet) IDs ¶
func (set *SectionSet) IDs() []uint
func (*SectionSet) Inflate ¶
func (set *SectionSet) Inflate() error
func (*SectionSet) Len ¶
func (set *SectionSet) Len() uint
func (*SectionSet) LineageIDsStringToNames ¶ added in v0.5.0
func (set *SectionSet) LineageIDsStringToNames(lin, sep string) (string, error)
func (*SectionSet) ReadFileJSON ¶ added in v0.3.0
func (set *SectionSet) ReadFileJSON(filename string) error
func (*SectionSet) WriteFileJSON ¶
Click to show internal directories.
Click to hide internal directories.