gh

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 8 Imported by: 4

README

gh

Go Reference

GitHub API helpers for various FerretDB projects.

Documentation

Overview

Package gh provides GitHub API helpers used by many FerretDB repos.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRESTClient

func NewRESTClient(token string, debugf Printf) (*github.Client, error)

NewRESTClient returns GitHub REST API client for the given token (that may be empty) and debug logging function (that may be nil).

func NewTransport

func NewTransport(source http.RoundTripper, debugf Printf) http.RoundTripper

NewTransport returns a new http.RoundTripper that wraps the source with debug logging. Both should be set.

func NoopPrintf

func NoopPrintf(string, ...any)

NoopPrintf is a Printf function that does nothing.

Types

type Printf

type Printf func(format string, args ...any)

Printf is a (fmt.Printf|log.Printf|testing.T.Logf)-like function.

func SLogPrintf added in v0.1.6

func SLogPrintf(l *slog.Logger) Printf

SLogPrintf is a Printf function that uses given slog.Logger with Debug level.

Jump to

Keyboard shortcuts

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