Documentation ¶
Index ¶
Constants ¶
const ( // SAMPLETOKEN is a example of valid token SAMPLETOKEN = "7-EtgZGHhpONO7shfeZXxKEX66WXuE9-" // SAMPLESUMMARY is a example of a valid summary SAMPLESUMMARY = "This is a Summary" // SAMPLEDESCRIPTION is a example of a valid description SAMPLEDESCRIPTION = "This is a Description" // SAMPLECATEGORYNAME is a example of a valid category name SAMPLECATEGORYNAME = "This is a Category Name" // SAMPLEPROJECTNAME is a example of a valid project name SAMPLEPROJECTNAME = "This is a Project Name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseIssue ¶
type BaseIssue struct { // Summary: We recommend putting your err.Error() here Summary string `valid:"required" json:"summary"` // Description: We recommend you put the object transited at the moment // of the error here in a serialized format (JSON) Description string `valid:"required" json:"description"` Category *Rel `valid:"required" json:"category"` Project *Project `valid:"required" json:"project"` }
BaseIssue represent the minimal information required to submit a valid issue report to MantisBT using the package BlueMantis. Please notice that all of the data must be set, including the minimal data from Category and Project.
type Client ¶
type Client struct { *http.Client URL string Token string Scheduler *cron.Cron SchedulerInterval string }
Client represents the basic structure that contains the configuration needed for a valid communication with any given Mantis Bug Tracker instance. It should not be created directly, please make use of the function NewClient to create a valid and most importantly, tested, Client.
func NewClient ¶
NewClient creates and test (including the connection) with a MantisBT server and returns a validated pointer to a Client struct for usage in your application. In case of a invalid URL, invalid Token, or communication failure with the MantisBT desired installation, it will return nil and a descriptive error with the problem.
type ExtendedIssue ¶
type ExtendedIssue struct { Status *Status `valid:"-" json:"status"` Reporter *Reporter `valid:"-" json:"reporter"` Resolution *Rel `valid:"-" json:"resolution"` ViewState *Rel `valid:"-" json:"view_state"` Priority *Rel `valid:"-" json:"priority"` Severity *Rel `valid:"-" json:"severity"` Reproducibility *Rel `valid:"-" json:"reproducibility"` Sticky bool `valid:"-" json:"sticky"` Meta }
ExtendedIssue represent the complete (not including history atm) information recommended to submit a valid issue report to MantisBT using the package BlueMantis. Please notice that all of this data is optional, and Mantis will normally assign default values for all of this relations. You should use name if you don't know a object given ID. Do not use label for this.
type Issue ¶
type Issue struct { Client *Client *BaseIssue *ExtendedIssue // contains filtered or unexported fields }
Issue represents the basic structure that contains a client, the necessary data to create the issue in MantisBT and a request-response pair, that will hold the request sent/to be send to MantisBT and the response received/ to be received by the MantisBT application. It should not be manually created. It is preferred to be created with the NewIssue(), that receive the BaseIssue and the ExtendedIssue structs.
func (*Issue) Retry ¶
Retry do a second attempt of a immediate request to the MantisBT server using the same information used before. Best used together with Send, like: newIssue.Send().Retry().RetryLater()
func (*Issue) RetryLater ¶
RetryLater will schedule using CRON a new execution of the function send, using as a delay value the configuration informed when creating a MantisBT client.
type Meta ¶
type Meta struct { CreatedAt time.Time `valid:"-" json:"created_at"` UpdatedAt time.Time `valid:"-" json:"updated_at"` }
Meta stores time sensitive information, such as last time a given object was created, edited, deleted and by whom those operations have been done.
type Project ¶
type Project struct { ID uint64 `valid:"optional" json:"id"` Name string `valid:"required" json:"name"` Description string `valid:"optional" json:"description"` Enabled bool `valid:"optional" json:"enabled"` Status Status `valid:"-" json:"status"` ViewState Rel `valid:"-" json:"view_state"` FilePath string `valid:"_" json:"file_path"` }
Project represents a instance of a project, as a single MantisBT application can support logging bugs and errors from multiple projects at the same time.
type Rel ¶
type Rel struct { ID uint64 `valid:"optional" json:"id"` Name string `valid:"required" json:"name"` Label string `valid:"optional" json:"label"` }
Rel represent a generic relationship with a different object, such as Categories, Fields, Handlers, Status and etc. It is usually re-labeled to match the object name through the package.