token

package module
v0.0.0-...-ac269f4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: MIT Imports: 9 Imported by: 1

README

go-github-token

GoDoc Go Report Card
Very easy to get github access token library written in Go.
This is a library that can get github personal access token by entering github's username and password (also two factor code).

Install

go get -u "github.com/Code-Hex/go-github-token"

Synopsis

See https://github.com/Code-Hex/go-github-token/blob/master/cmd/tkn/main.go

Author

codehex

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AppName use to github-access-token's note
	AppName = "go-github-token"
	// UserAgent value
	UserAgent = AppName + " v" + version
	// NoteURL to use github-access-token's note
	NoteURL = "https://github.com/Code-Hex/github-token"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Auth      octokit.BasicAuth
	TokenNote string
	// contains filtered or unexported fields
}

Client is the struct :D

func New

func New() *Client

New will return *token.Client set with http.DefaultClient.

func NewWithClient

func NewWithClient(client *http.Client) *Client

NewWithClient will return *token.Client set with your defined *http.Client.

func (*Client) CreateToken

func (c *Client) CreateToken() (string, error)

CreateToken create a token based on the information of the *token.Client struct.

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() (token string, err error)

GetAccessToken enter the necessary information to obtain the token.

func (*Client) ReadOTP

func (c *Client) ReadOTP() (err error)

ReadOTP read two factor authentication code from prompt input.

func (*Client) ReadPassword

func (c *Client) ReadPassword() (err error)

ReadPassword read password from prompt input.

func (*Client) ReadUsername

func (c *Client) ReadUsername() (err error)

ReadUsername read username from prompt input.

Directories

Path Synopsis
cmd
tkn

Jump to

Keyboard shortcuts

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