ghrest

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Overview

Package ghrest provides a wrapper around the go-github client that implements the internal REST API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GhRest

type GhRest struct {
	// contains filtered or unexported fields
}

GhRest is the struct that contains the GitHub REST API client this struct implements the REST API

func NewGhRest

func NewGhRest(token string) *GhRest

NewGhRest creates a new instance of GhRest

func (*GhRest) Do

func (c *GhRest) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do sends an API request and returns the API response.

func (*GhRest) NewRequest

func (c *GhRest) NewRequest(method, requestUrl string, body any) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

Jump to

Keyboard shortcuts

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