Documentation ¶
Index ¶
- type Client
- func (c *Client) GetFile(ctx context.Context, path string) (string, error)
- func (c *Client) Init(ctx context.Context, hc *http.Client, gerritHost string, gitilesHost string, ...) error
- func (c *Client) SubmitChange(ctx context.Context, changeInfo *gerritpb.ChangeInfo) (string, error)
- func (c *Client) SwitchProject(ctx context.Context, project string) error
- func (c *Client) UpdateFiles(ctx context.Context, subject string, contents map[string]string) (*gerritpb.ChangeInfo, error)
- type ClientInterface
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
}
Client consists of resources needed for querying gitiles and gerrit.
func NewClient ¶
func NewClient(ctx context.Context, hc *http.Client, gerritHost, gitilesHost, project, branch string) (*Client, error)
NewClient produces a new client using only simple types available in a command line context
func (*Client) GetFile ¶
GetFile returns the contents of the file located at a given path within the project
func (*Client) Init ¶
func (c *Client) Init(ctx context.Context, hc *http.Client, gerritHost string, gitilesHost string, project string, branch string) error
Init takes an http Client, hostnames, a project name, and a branch and populates the fields of the client
func (*Client) SubmitChange ¶
SubmitChange takes a change and submits it, returns a gerrit url upon success
func (*Client) SwitchProject ¶
SwitchProject switches the project and changes the latest hash to fetch.
func (*Client) UpdateFiles ¶
func (c *Client) UpdateFiles(ctx context.Context, subject string, contents map[string]string) (*gerritpb.ChangeInfo, error)
UpdateFiles associates new contents with a path in a gerrit repo.
subject: the subject of the CL contents: the mapping between file path and its new contents