package github
import "github.com/oslokommune/okctl/pkg/github"
Package github provides a client for interacting with the Github API
Index ¶
- Constants
- func BoolPtr(v bool) *bool
- func Int64Ptr(v int64) *int64
- func StringPtr(v string) *string
- type Github
- func New(ctx context.Context, auth githubAuth.Authenticator) (*Github, error)
- func (g *Github) CreateDeployKey(org, repository, title, publicKey string) (*Key, error)
- func (g *Github) CreatePullRequest(r *PullRequest) error
- func (g *Github) DeleteDeployKey(org, repository string, identifier int64) error
- func (g *Github) ListReleases(owner, repo string) ([]*RepositoryRelease, error)
- func (g *Github) Repositories(org string) ([]*Repository, error)
- func (g *Github) Teams(org string) ([]*Team, error)
- type Githuber
- type Key
- type PullRequest
- type ReleaseAsset
- type Repository
- type RepositoryRelease
- type Team
Constants ¶
const DefaultAWSInfrastructurePrimaryBranch = "master"
DefaultAWSInfrastructurePrimaryBranch is the name of the primary branch (due to git/github moving away from "master" to "main")
const DefaultAWSInfrastructureRepository = "origo-aws-infrastructure"
DefaultAWSInfrastructureRepository is the name of the infrastructure as code repository which should be given nameserver delegation requests
const DefaultOrg = "oslokommune"
DefaultOrg is the default organisation used with okctl
const ListReleasesPageSize = 100
ListReleasesPageSize is the number of releases to fetch per page
Functions ¶
func BoolPtr ¶
BoolPtr returns a pointer to the bool
func Int64Ptr ¶
Int64Ptr returns a pointer to the int64
func StringPtr ¶
StringPtr returns a pointer to the string
Types ¶
type Github ¶
Github contains the state for interacting with the github API
func New ¶
func New(ctx context.Context, auth githubAuth.Authenticator) (*Github, error)
New returns an initialised github API client
func (*Github) CreateDeployKey ¶
CreateDeployKey creates a read-only deploy key for the given owner/repo
func (*Github) CreatePullRequest ¶
func (g *Github) CreatePullRequest(r *PullRequest) error
CreatePullRequest creates a pull request from sourceBranch to destinationBranch
func (*Github) DeleteDeployKey ¶
DeleteDeployKey removes a read-only deploy key
func (*Github) ListReleases ¶
func (g *Github) ListReleases(owner, repo string) ([]*RepositoryRelease, error)
ListReleases lists the given repository's releases
func (*Github) Repositories ¶
func (g *Github) Repositories(org string) ([]*Repository, error)
Repositories fetches all the repositories within the given organisation
func (*Github) Teams ¶
Teams fetches all teams within the given organisation
type Githuber ¶
type Githuber interface { Teams(org string) ([]*Team, error) Repositories(org string) ([]*Repository, error) CreateDeployKey(org, repository, title, publicKey string) (*Key, error) DeleteDeployKey(org, repository string, id int64) error CreatePullRequest(r *PullRequest) error ListReleases(owner, repo string) ([]*RepositoryRelease, error) }
Githuber invokes the github API
type Key ¶
Key shadows github.Key
type PullRequest ¶
type PullRequest struct { Organisation string Repository string SourceBranch string DestinationBranch string Title string Body string Labels []string }
PullRequest contains data about the PR
type ReleaseAsset ¶
type ReleaseAsset = github.ReleaseAsset
ReleaseAsset shadows github.ReleaseAsset
type Repository ¶
type Repository = github.Repository
Repository shadows github.Repository
type RepositoryRelease ¶
type RepositoryRelease = github.RepositoryRelease
RepositoryRelease shadows github.RepositoryRelease
type Team ¶
Team shadows github.Team
Source Files ¶
- Version
- v0.0.106 (latest)
- Published
- Oct 21, 2022
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 18 hours ago –
Tools for package owners.