apptoken

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

GitHub App Access Token

This is a go module that provides you with a client, which can generate an access token for your GitHub App.

What's in the box?

You can retrieve a GitHub Application Token from the library.

Installation Guidelines

  1. To install the github-app-token package, you first need to have Go installed, then you can use the command below to add github-app-token as a dependency in your Go program.

    go get github.com/sumeetpatil/github-app-token
    
  2. Import it in your code:

    import "github.com/sumeetpatil/github-app-token"
    

Usage

You can follow this example for your usage -

Documentation

Index

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
}

func NewClient

func NewClient(ctx context.Context, options ClientOptions) (*Client, error)

func (*Client) GetInstallationID

func (g *Client) GetInstallationID(ctx context.Context) (*github.Installation, error)

func (*Client) GetToken

func (g *Client) GetToken(ctx context.Context, installationID int64) (string, error)

type ClientOptions

type ClientOptions struct {
	PrivateKeyPath string
	RepoURL        string
	GithubAppID    string
}

type RepoInfo

type RepoInfo struct {
	HostName string
	Repo     string
	Owner    string
	ApiUrl   string
	PRNumber int
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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