github

package
v0.0.0-...-6f0b551 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultOrganization = "navikt"
)

Variables

This section is empty.

Functions

func NewHTTPClientFromGithubAppCredentials

func NewHTTPClientFromGithubAppCredentials(applicationID, installationID int64, privateKey string) (*http.Client, error)

Types

type Branch

type Branch struct {
	Name string
}

type Client

type Client struct {
	Org string
	// contains filtered or unexported fields
}

func New

func New(org string, ghc *github.Client) *Client

func NewFromHTTPClient

func NewFromHTTPClient(org string, c *http.Client) *Client

func (*Client) Branches

func (c *Client) Branches(ctx context.Context, r Repository) ([]Branch, error)

func (*Client) Repositories

func (c *Client) Repositories(ctx context.Context) ([]Repository, error)

type Fetcher

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

func NewFetcher

func NewFetcher(l Lister, log *logrus.Entry) *Fetcher

func (*Fetcher) Branches

func (s *Fetcher) Branches(ctx context.Context, repo Repository) (Repository, error)

func (*Fetcher) Refresh

func (s *Fetcher) Refresh(ctx context.Context) (int, error)

func (*Fetcher) Repositories

func (s *Fetcher) Repositories() map[string]Repository

func (*Fetcher) StartRefreshLoop

func (s *Fetcher) StartRefreshLoop(ctx context.Context, interval time.Duration)

type Lister

type Lister interface {
	Repositories(ctx context.Context) ([]Repository, error)
	Branches(ctx context.Context, r Repository) ([]Branch, error)
}

type Repository

type Repository struct {
	Name     string
	FullName string
	Branches []Branch
}

type StaticLister

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

func NewStaticLister

func NewStaticLister(repos []Repository, branches map[string][]Branch) *StaticLister

func (*StaticLister) Branches

func (s *StaticLister) Branches(_ context.Context, r Repository) ([]Branch, error)

func (*StaticLister) Repositories

func (s *StaticLister) Repositories(_ context.Context) ([]Repository, error)

Jump to

Keyboard shortcuts

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