Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateAttachment(attachment *attachments.Create) (*attachments.CreateResponse, error)
- func (c *Client) CreateBug(bug *bugs.Create) (*bugs.CreateResponse, error)
- func (c *Client) GetBug(bug int) (*bugs.GetResponse, error)
- func (c *Client) IDFromShowBug(url string) (int, error)
- func (c *Client) ShowBug(id int) string
- func (c *Client) UpdateBug(bug *bugs.Update) (*bugs.UpdateResponse, error)
- func (c *Client) Version() (*general.VersionResponse, error)
- func (c *Client) WithAuth(authenticator auth.Authenticator) *Client
- func (c *Client) WithToolHeader(tool string) *Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient constructs an unauthenticated client. To add and authenticator please see the WithAuth method.
The provided "host" string must be <protocol>://<hostname>[:<port>] WITHOUT any path. The "rest" resource is automatically appended to every constructed client.
func (*Client) CreateAttachment ¶
func (c *Client) CreateAttachment(attachment *attachments.Create) (*attachments.CreateResponse, error)
func (*Client) IDFromShowBug ¶
IDFromShowBug takes in a string that was constructed from Client.ShowBug and returns back the original ID number.
func (*Client) ShowBug ¶
ShowBug returns a URL formatted for the configured Bugzilla instance that is of the format <SCHEME>://<HOST>/show_bug.cgi?id=<BUG_ID>
This is the GUI web view for the given bug id.
func (*Client) WithToolHeader ¶
WithToolHeader sets the header value for X-AUTOMATED-TOOL, which is sent with every request.
By default, this is set to "https://github.com/mozilla/OneCRL-Tools/bugzilla", however it would be appreciated if consumers of this library set this to pointer to the code that is actually making API calls.