client

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func NewClient(host string) *Client

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) CreateBug

func (c *Client) CreateBug(bug *bugs.Create) (*bugs.CreateResponse, error)

func (*Client) GetBug

func (c *Client) GetBug(bug int) (*bugs.GetResponse, error)

func (*Client) IDFromShowBug

func (c *Client) IDFromShowBug(url string) (int, error)

IDFromShowBug takes in a string that was constructed from Client.ShowBug and returns back the original ID number.

func (*Client) ShowBug

func (c *Client) ShowBug(id int) string

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) UpdateBug

func (c *Client) UpdateBug(bug *bugs.Update) (*bugs.UpdateResponse, error)

func (*Client) Version

func (c *Client) Version() (*general.VersionResponse, error)

func (*Client) WithAuth

func (c *Client) WithAuth(authenticator auth.Authenticator) *Client

func (*Client) WithToolHeader

func (c *Client) WithToolHeader(tool string) *Client

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.

Jump to

Keyboard shortcuts

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