mantis

package module
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

Go client to MantisConnect SOAP server

Example

See ./cmd/mantiscli.

Install

go get github.com/tgulacsi/mantis-soap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger added in v0.3.0

func SetLogger(lgr *slog.Logger)

Types

type AccountData

type AccountData struct {
	//XMLName  xml.Name `xml:"account_data,omitempty"`
	ID       int    `xml:"id,omitempty"`
	Name     string `xml:"name,omitempty"`
	RealName string `xml:"real_name,omitempty"`
	Email    string `xml:"email,omitempty"`
}

type AttachmentData

type AttachmentData struct {
	ID            int    `xml:"id,omitempty"`
	FileName      string `xml:"filename,omitempty"`
	Size          int    `xml:"size,omitempty"`
	ContentType   string `xml:"content_type,omitempty"`
	DateSubmitted Time   `xml:"date_submitted,omitempty"`
	DownloadURL   string `xml:"download_url,omitempty"`
	UserID        int    `xml:"user_id,omitempty"`
}

type Auth

type Auth struct {
	Username string `xml:"username"`
	Password string `xml:"password"`
}

type Client

type Client struct {
	soaphlp.Caller

	User AccountData
	*slog.Logger
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, baseURL, username, password string) (Client, error)

func NewWithHTTPClient

func NewWithHTTPClient(ctx context.Context, c *http.Client, baseURL, username, password string) (Client, error)

func (Client) Call

func (c Client) Call(ctx context.Context, method string, request, response interface{}) error

func (Client) FilterSearchIssueIDs

func (c Client) FilterSearchIssueIDs(ctx context.Context, filter FilterSearchData, pageNumber, perPage int) ([]int, error)

func (Client) GetCategoriesForProject

func (c Client) GetCategoriesForProject(ctx context.Context, projectID int) (ProjectCategoriesResp, error)

GetCategoriesForProject - get the categories belonging to the specified project.

func (Client) IssueAdd

func (c Client) IssueAdd(ctx context.Context, issue IssueData) (int, error)

func (Client) IssueAttachmentAdd

func (c Client) IssueAttachmentAdd(ctx context.Context, issueID int, name, fileType string, content io.Reader) (int, error)

func (Client) IssueExists

func (c Client) IssueExists(ctx context.Context, issueID int) (bool, error)

func (Client) IssueGet

func (c Client) IssueGet(ctx context.Context, issueID int) (IssueData, error)

func (Client) IssueNoteAdd

func (c Client) IssueNoteAdd(ctx context.Context, issueID int, note IssueNoteData) (int, error)

func (Client) IssueUpdate

func (c Client) IssueUpdate(ctx context.Context, issueID int, issue IssueData) (bool, error)

func (Client) Login

func (c Client) Login(ctx context.Context) (LoginResponse, error)

func (Client) ProjectGetUsers

func (c Client) ProjectGetUsers(ctx context.Context, projectID, access int) ([]AccountData, error)

func (Client) ProjectIssues

func (c Client) ProjectIssues(ctx context.Context, projectID, page, perPage int) ([]IssueData, error)

func (Client) ProjectVersionAdd

func (c Client) ProjectVersionAdd(ctx context.Context, projectID int, name, description string, released, obsolete bool, date *Time) (int, error)

func (Client) ProjectVersionDelete

func (c Client) ProjectVersionDelete(ctx context.Context, versionID int) error

func (Client) ProjectVersionUpdate

func (c Client) ProjectVersionUpdate(ctx context.Context, version ProjectVersionData) error

func (Client) ProjectVersionsList

func (c Client) ProjectVersionsList(ctx context.Context, projectID int) ([]ProjectVersionData, error)

func (Client) ProjectsGetUserAccessible

func (c Client) ProjectsGetUserAccessible(ctx context.Context) ([]ProjectData, error)

func (Client) StatusEnum

func (c Client) StatusEnum(ctx context.Context) ([]ObjectRef, error)

type CustomFieldData

type CustomFieldData struct {
	Field ObjectRef `xml:"field,omitempty"`
	Value string    `xml:"value,omitempty"`
}

type FilterCustomField

type FilterCustomField struct {
	Field ObjectRef `xml:"field"`
	Value []string  `xml:"value"`
}

type FilterSearchData

type FilterSearchData struct {
	ProjectID            []int               `xml:"project_id,omitempty"`
	Search               string              `xml:"search,omitempty"`
	Category             []string            `xml:"category,omitempty"`
	SeverityID           []int               `xml:"severity_id,omitempty"`
	StatusID             []int               `xml:"status_id,omitempty"`
	PriorityID           []int               `xml:"priority_id,omitempty"`
	ReporterID           []int               `xml:"reporter_id,omitempty"`
	HandlerID            []int               `xml:"handler_id,omitempty"`
	NoteUserID           []int               `xml:"note_user_id,omitempty"`
	ResolutionID         []int               `xml:"resolution_id,omitempty"`
	ProductVersion       []string            `xml:"product_version,omitempty"`
	UserMonitorID        []int               `xml:"user_monitor_id,omitempty"`
	HideStatusID         []int               `xml:"hide_status_id,omitempty"`
	Sort                 string              `xml:"sort,omitempty"`
	SortDirection        string              `xml:"sort_direction,omitempty"`
	Sticky               *bool               `xml:"sticky,omitempty"`
	ViewStateID          []int               `xml:"view_state_id,omitempty"`
	FixedInVersion       []string            `xml:"fixed_in_version,omitempty"`
	TargetVersion        []string            `xml:"target_version,omitempty"`
	Platform             []string            `xml:"platform,omitempty"`
	OS                   []string            `xml:"os,omitempty"`
	OSBuild              []string            `xml:"os_build,omitempty"`
	StartDay             *int                `xml:"start_day,omitempty"`
	StartMonth           *int                `xml:"start_month,omitempty"`
	StartYear            *int                `xml:"start_year,omitempty"`
	EndDay               *int                `xml:"end_day,omitempty"`
	EndMonth             *int                `xml:"end_month,omitempty"`
	EndYear              *int                `xml:"end_year,omitempty"`
	LastUpdateStartDay   *int                `xml:"last_update_start_day,omitempty"`
	LastUpdateStartMonth *int                `xml:"last_update_start_month,omitempty"`
	LastUpdateStartYear  *int                `xml:"last_update_start_year,omitempty"`
	LastUpdateEndDay     *int                `xml:"last_update_end_day,omitempty"`
	LastUpdateEndMonth   *int                `xml:"last_update_end_month,omitempty"`
	LastUpdateEndYear    *int                `xml:"last_update_end_year,omitempty"`
	TagString            []string            `xml:"tag_string,omitempty"`
	TagSelect            []int               `xml:"tag_select,omitempty"`
	CustomFields         []FilterCustomField `xml:"custom_fields,omitempty"`
}

type FilterSearchIssueIDsRequest

type FilterSearchIssueIDsRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_filter_search_issue_ids"`
	Auth
	Filter     FilterSearchData `xml:"filter"`
	PageNumber int              `xml:"page_number"`
	PerPage    int              `xml:"per_page"`
}

type FilterSearchIssueIDsResponse

type FilterSearchIssueIDsResponse struct {
	XMLName xml.Name  `xml:"http://futureware.biz/mantisconnect mc_filter_search_issue_idsResponse"`
	IDs     []IssueID `xml:"return>item"`
}

type IssueAddRequest

type IssueAddRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_add"`
	Auth
	Issue IssueData `xml:"issue"`
}

type IssueAddResponse

type IssueAddResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_addResponse"`
	Return  int      `xml:"return"`
}

type IssueAttachmentAddRequest

type IssueAttachmentAddRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_attachment_add"`
	Auth
	IssueID  IssueID `xml:"issue_id"`
	Name     string  `xml:"name"`
	FileType string  `xml:"file_type"`
	Content  Reader  `xml:"content"`
}

type IssueAttachmentAddResponse

type IssueAttachmentAddResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_attachment_addResponse"`
	Return  int      `xml:"return"`
}

type IssueData

type IssueData struct {
	ID                    *IssueID           `xml:"id,omitempty"`
	ViewState             *ObjectRef         `xml:"view_state,omitempty"`
	LastUpdated           *Time              `xml:"last_updated,omitempty"`
	Project               *ObjectRef         `xml:"project,omitempty"`
	Category              *string            `xml:"category,omitempty"`
	Priority              *ObjectRef         `xml:"priority,omitempty"`
	Severity              *ObjectRef         `xml:"severity,omitempty"`
	Status                *ObjectRef         `xml:"status,omitempty"`
	Reporter              *AccountData       `xml:"reporter,omitempty"`
	Summary               *string            `xml:"summary,omitempty"`
	Version               *string            `xml:"version,omitempty"`
	Build                 *string            `xml:"build,omitempty"`
	Platform              *string            `xml:"platform,omitempty"`
	Os                    *string            `xml:"os,omitempty"`
	OsBuild               *string            `xml:"os_build,omitempty"`
	Reproducibility       *ObjectRef         `xml:"reproducibility,omitempty"`
	DateSubmitted         *Time              `xml:"date_submitted,omitempty"`
	SponsorshipTotal      *int               `xml:"sponsorship_total,omitempty"`
	Handler               *AccountData       `xml:"handler,omitempty"`
	Projection            *ObjectRef         `xml:"projection,omitempty"`
	ETA                   *ObjectRef         `xml:"eta,omitempty"`
	Resolution            *ObjectRef         `xml:"resolution,omitempty"`
	FixedInVersion        *string            `xml:"fixed_in_version,omitempty"`
	TargetVersion         *string            `xml:"target_version,omitempty"`
	Description           *string            `xml:"description,omitempty"`
	StepsToReproduce      *string            `xml:"steps_to_reproduce,omitempty"`
	AdditionalInformation *string            `xml:"additional_information,omitempty"`
	Attachments           []AttachmentData   `xml:"attachments>item,omitempty"`
	Relationships         []RelationshipData `xml:"relationships>item,omitempty"`
	Notes                 []NoteData         `xml:"notes>item,omitempty"`
	CustomFields          []CustomFieldData  `xml:"custom_fields>item,omitempty"`
	DueDate               *Time              `xml:"due_date,omitempty"`
	Monitors              []AccountData      `xml:"monitors>item,omitempty"`
	Sticky                *bool              `xml:"sticky,omitempty"`
	Tags                  []ObjectRef        `xml:"tags>item,omitempty"`
}

type IssueExistsRequest

type IssueExistsRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_exists"`
	Auth
	IssueID IssueID `xml:"issue_id"`
}

type IssueExistsResponse

type IssueExistsResponse struct {
	Return bool `xml:"return"`
}

type IssueGetRequest

type IssueGetRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_get"`
	Auth
	IssueID IssueID `xml:"issue_id"`
}

type IssueGetResponse

type IssueGetResponse struct {
	XMLName xml.Name  `xml:"http://futureware.biz/mantisconnect mc_issue_getResponse"`
	Return  IssueData `xml:"return"`
}

type IssueID

type IssueID int

func (IssueID) MarshalXML

func (id IssueID) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*IssueID) UnmarshalXML

func (id *IssueID) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type IssueNoteAddRequest

type IssueNoteAddRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_note_add"`
	Auth
	IssueID IssueID       `xml:"issue_id"`
	Note    IssueNoteData `xml:"note"`
}

type IssueNoteAddResponse

type IssueNoteAddResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_note_addResponse"`
	Return  int      `xml:"return"`
}

type IssueNoteData

type IssueNoteData struct {
	ID            *int        `xml:"id,omitempty"`
	Reporter      AccountData `xml:"reporter,omitempty"`
	Text          string      `xml:"text,omitempty"`
	ViewState     *ObjectRef  `xml:"view_state,omitempty"`
	DateSubmitted Time        `xml:"date_submitted,omitempty"`
	LastModified  Time        `xml:"last_modified,omitempty"`
	TimeTracking  *int        `xml:"time_tracking,omitempty"`
	NoteType      *int        `xml:"note_type,omitempty"`
	NoteAttr      string      `xml:"note_attr,omitempty"`
}

type IssueUpdateRequest

type IssueUpdateRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_update"`
	Auth
	IssueID IssueID   `xml:"issueId"`
	Issue   IssueData `xml:"issue"`
}

type IssueUpdateResponse

type IssueUpdateResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_issue_updateResponse"`
	Return  bool     `xml:"return"`
}

type LoginRequest

type LoginRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_login"`
	Auth
}

type LoginResponse

type LoginResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_loginResponse"`
	Return  UserData `xml:"return"`
}

type NoteData

type NoteData struct {
	ID            int         `xml:"id,omitempty"`
	Reporter      AccountData `xml:"reporter,omitempty"`
	Text          string      `xml:"text"`
	ViewState     *ObjectRef  `xml:"view_state,omitempty"`
	DateSubmitted Time        `xml:"date_submitted,omitempty"`
	LastModified  Time        `xml:"last_modified,omitempty"`
	TimeTracking  int         `xml:"time_tracking,omitempty"`
	NoteType      int         `xml:"note_type,omitempty"`
	NoteAttr      string      `xml:"note_attr,omitempty"`
}

type ObjectRef

type ObjectRef struct {
	ID   int    `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type ProjectCategoriesReq

type ProjectCategoriesReq struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_categories"`
	Auth
	ProjectID int `xml:"project_id"`
}

type ProjectCategoriesResp

type ProjectCategoriesResp struct {
	XMLName    xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_categoriesResponse"`
	Categories []string `xml:"return>item"`
}

type ProjectData

type ProjectData struct {
	ID            int           `xml:"id,omitempty"`
	Name          string        `xml:"name,omitempty"`
	Status        *ObjectRef    `xml:"status,omitempty"`
	Enabled       bool          `xml:"enabled"`
	ViewState     *ObjectRef    `xml:"view_state,omitempty"`
	AccessMin     *ObjectRef    `xml:"access_min,omitempty"`
	FilePath      string        `xml:"file_path,omitempty"`
	Description   string        `xml:"description,omitempty"`
	Subprojects   []ProjectData `xml:"subprojects>item,omitempty"`
	InheritGlobal bool          `xml:"inherit_global,omitempty"`
}

type ProjectGetReleasedVersionsRequest

type ProjectGetReleasedVersionsRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_released_versionsRequest"`
	Auth
	ProjectID int `xml:"project_id"`
}

type ProjectGetReleasedVersionsResponse

type ProjectGetReleasedVersionsResponse struct {
	XMLName xml.Name             `xml:"http://futureware.biz/mantisconnect mc_project_get_released_versionsResponse"`
	Return  []ProjectVersionData `xml:"return>item"`
}

type ProjectGetUnreleasedVersionsRequest

type ProjectGetUnreleasedVersionsRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_unreleased_versionsRequest"`
	Auth
	ProjectID int `xml:"project_id"`
}

type ProjectGetUnreleasedVersionsResponse

type ProjectGetUnreleasedVersionsResponse struct {
	XMLName xml.Name             `xml:"http://futureware.biz/mantisconnect mc_project_get_unreleased_versionsResponse"`
	Return  []ProjectVersionData `xml:"return>item"`
}

type ProjectGetUsersRequest

type ProjectGetUsersRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_users"`
	Auth
	ProjectID int `xml:"project_id"`
	Access    int `xml:"access"`
}

type ProjectGetUsersResponse

type ProjectGetUsersResponse struct {
	XMLName xml.Name      `xml:"http://futureware.biz/mantisconnect mc_project_get_usersResponse"`
	Users   []AccountData `xml:"return>item"`
}

type ProjectGetVersionsRequest

type ProjectGetVersionsRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_versions"`
	Auth
	ProjectID int `xml:"project_id"`
}

type ProjectGetVersionsResponse

type ProjectGetVersionsResponse struct {
	XMLName xml.Name             `xml:"http://futureware.biz/mantisconnect mc_project_get_versionsResponse"`
	Return  []ProjectVersionData `xml:"return>item"`
}

type ProjectIssuesRequest

type ProjectIssuesRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_get_issues"`
	Auth
	ProjectID  int `xml:"project_id"`
	PageNumber int `xml:"page_number"`
	PerPage    int `xml:"per_page"`
}

type ProjectIssuesResponse

type ProjectIssuesResponse struct {
	XMLName xml.Name    `xml:"http://futureware.biz/mantisconnect mc_project_get_issuesResponse"`
	Issues  []IssueData `xml:"return>item"`
}

type ProjectVersionAddRequest

type ProjectVersionAddRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_add"`
	Auth
	Version ProjectVersionData `xml:"version"`
}

type ProjectVersionAddResponse

type ProjectVersionAddResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_addResponse"`
	Return  int      `xml:"return"`
}

type ProjectVersionData

type ProjectVersionData struct {
	ID          int    `xml:"id"`
	Name        string `xml:"name"`
	ProjectID   int    `xml:"project_id"`
	DateOrder   *Time  `xml:"date_order"`
	Description string `xml:"description"`
	Released    bool   `xml:"released"`
	Obsolete    bool   `xml:"obsolete"`
}

type ProjectVersionDeleteRequest

type ProjectVersionDeleteRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_deleteRequest"`
	Auth
	VersionID int `xml:"version_id"`
}

type ProjectVersionDeleteResponse

type ProjectVersionDeleteResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_deleteResponse"`
	Return  bool     `xml:"return"`
}

type ProjectVersionUpdateRequest

type ProjectVersionUpdateRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_update"`
	Auth
	VersionID int                `xml:"version_id"`
	Version   ProjectVersionData `xml:"version"`
}

type ProjectVersionUpdateResponse

type ProjectVersionUpdateResponse struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_project_version_updateResponse"`
	Return  bool     `xml:"return"`
}

type ProjectsGetUserAccessibleRequest

type ProjectsGetUserAccessibleRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_projects_get_user_accessible"`
	Auth
}

type ProjectsGetUserAccessibleResponse

type ProjectsGetUserAccessibleResponse struct {
	XMLName  xml.Name      `xml:"http://futureware.biz/mantisconnect mc_projects_get_user_accessibleResponse"`
	Projects []ProjectData `xml:"return>item"`
}

type Reader

type Reader struct {
	io.Reader
}

func (Reader) MarshalXML

func (r Reader) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type RelationshipData

type RelationshipData struct {
	ID       int       `xml:"id,omitempty"`
	Type     ObjectRef `xml:"type,omitempty"`
	TargetID int       `xml:"target_id,omitempty"`
}

type StatusEnumRequest

type StatusEnumRequest struct {
	XMLName xml.Name `xml:"http://futureware.biz/mantisconnect mc_enum_status"`
	Auth
}

type StatusEnumResponse

type StatusEnumResponse struct {
	XMLName  xml.Name    `xml:"http://futureware.biz/mantisconnect mc_enum_statusResponse"`
	Statuses []ObjectRef `xml:"return>item"`
}

type Time

type Time time.Time

func (*Time) IsZero

func (t *Time) IsZero() bool

func (*Time) MarshalJSON added in v0.2.5

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalXML added in v0.2.5

func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Time) UnmarshalText added in v0.2.5

func (t *Time) UnmarshalText(p []byte) error

func (*Time) UnmarshalXML

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type UserData

type UserData struct {
	Account     AccountData `xml:"account_data,omitempty"`
	AccessLevel int         `xml:"access_level,omitempty"`
	Timezone    string      `xml:"timezone,omitempty"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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