github

package module
v0.0.0-...-8ce7282 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

README

Github Readme

This library is used to get GitHub readme content in HTML as well as in JSON format

How to use it


	src := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: "<!-- Your github access token -->"},
	)
	ctx := context.Background()
	httpClient := oauth2.NewClient(ctx, src)
	githubClient := github.NewGithub(httpClient)

	content, err := githubClient.GetReadme(ctx, "<!-- organization name -->", "<!-- Github repository name -->")

	fmt.Println(content)
	fmt.Println(err)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Github

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

func NewGithub

func NewGithub(client *http.Client) *Github

NewGithub initialized Github

func (*Github) GetReadme

func (g *Github) GetReadme(ctx context.Context, owner string, repo string) (string, error)

GetReadme returns readme content in HTML as well as in JSON format

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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