utils

package
v0.0.0-...-606e2ae Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewBranch

func CreateNewBranch(ghClient *github.Client,
	githubBranch string,
	githubUser string,
	githubRepoName string) error

CreateNewBranch creates a new branch from main branch

func CreateNewPullRequest

func CreateNewPullRequest(ghClient *github.Client,
	githubBranch string,
	githubUser string,
	githubRepoName string) (string, error)

CreateNewPullRequest creates a new pull request from specified `githubBranch` to `main` branch

func DisplaySuccess

func DisplaySuccess(w http.ResponseWriter, githubAccessToken string, prURL string) error

DisplaySuccess function displays success message

func GetFileBlobSHA

func GetFileBlobSHA(ghClient *github.Client,
	githubBranch string,
	githubUser string,
	githubRepoName string,
	githubFileName string) (string, error)

GetFileBlobSHA returns SHA of given file from given branch

func GetGithubAccessToken

func GetGithubAccessToken(code string) string

GetGithubAccessToken returns Github access token

func GetGithubClientID

func GetGithubClientID() string

GetGithubClientID returns Github OAuth app client ID from set environment variable CLIENT_ID

func GetGithubClientSecret

func GetGithubClientSecret() string

GetGithubClientSecret returns Github OAuth app client secret from set environment variable CLIENT_SECRET

func GetGithubData

func GetGithubData(accessToken string) (string, error)

GetGithubData returns Github user data of autorized user

func UpdateFile

func UpdateFile(ghClient *github.Client,
	githubBranch string,
	fileSHA string,
	githubUserFullName string,
	githubUserEmailID string,
	githubUser string,
	githubRepoName string,
	githubFileName string) error

UpdateFile updates given file in specified repository

Types

This section is empty.

Jump to

Keyboard shortcuts

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