ghclients

package
v0.0.0-...-3d71f35 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ghclients stores ghclients with caching and auth for installations of a GitHub App

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GHClients

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

GHClients stores clients per-installation for re-use throughout a process.

func NewGHClients

func NewGHClients(ctx context.Context, t http.RoundTripper) (*GHClients, error)

NewGHClients returns a new GHClients. The provided RoundTripper will be stored and used when creating new clients.

func (*GHClients) Free

func (g *GHClients) Free(i int64)

func (*GHClients) Get

func (g *GHClients) Get(i int64) (*github.Client, error)

Get gets the client for installation id i, If i is 0 it gets the client for the app-level api. If a stored client is not available, it creates a new client with auth and caching built in.

type GhClientsInterface

type GhClientsInterface interface {
	Get(i int64) (*github.Client, error)
	Free(i int64)
}

Jump to

Keyboard shortcuts

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