github

package
v0.0.0-...-6db6e34 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuesURL     = "https://api.github.com/repos/"
	ReposURL      = "https://api.github.com/user/repos"
	UserReposURL  = "https://api.github.com/repos/"
	MethodGet     = "GET"
	MethodHead    = "HEAD"
	MethodPost    = "POST"
	MethodPut     = "PUT"
	MethodPatch   = "PATCH" // RFC 5789
	MethodDelete  = "DELETE"
	MethodConnect = "CONNECT"
	MethodOptions = "OPTIONS"
	MethodTrace   = "TRACE"
)

Variables

This section is empty.

Functions

func GetIssues

func GetIssues(PersonalAccessToken, URL, Action string) (*[]Issues, error)

Get Issue list from repo for the user

func GetUserinfo

func GetUserinfo() (string, string, string)

Get user info including userid/token/passwd

func MoveFile

func MoveFile(from, to string)

replace yamlfile file

func Parsehttpurl

func Parsehttpurl(Filepath, State, IssueNumber string, Locked bool) (string, string, string, *[]byte)

parse http url request for get/post/patch/put

func ReadTemplate

func ReadTemplate(Filepath string) []byte

read the yaml file of repo/issue template, which will be removed in the future

func UpdateIssues

func UpdateIssues(PersonalAccessToken, URL, Action string, data *[]byte) string

post/patch/put for issue update

func UpdateUserinfo

func UpdateUserinfo(id, idtoken, idrepo string)

update user info as the parameter

func WriteToFile

func WriteToFile(f string, d []byte)

generate the tempfile for yamlfile

Types

type Assignees

type Assignees struct {
	Login   string
	HTMLURL string `json:"html_url"`
}

type Issues

type Issues struct {
	Number    int
	HTMLURL   string `json:"html_url"`
	Title     string
	State     string
	Locked    bool
	Assignees *[]Assignees
	CreateAt  time.Time `json:"created_at"`
	Body      string
}

type Issueyamlfile

type Issueyamlfile struct {
	Title     string   `yaml:"title"`
	Body      string   `yaml:"body"`
	Assignees []string `yaml:"assignees"`
	State     string   `yaml:"state"`
	Locked    bool     `yaml:"locked"`
	Labels    []string `yaml:"labels"`
}

func (*Issueyamlfile) UpdateIssueyaml

func (yamlfile *Issueyamlfile) UpdateIssueyaml(Title, Body, State string, Locked bool, Assignees, Labels *[]string) (*[]byte, string, bool)

update yaml file of issue template

type Owner

type Owner struct {
	Login string `json:"login"`
}

type Repos

type Repos struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Private     bool   `json:"private"`
	Owner       Owner
	HTMLURL     string `json:"html_url"`
	Description string `json:"description"`
	Homepage    string `json:"homepage"`
	Fork        bool
	Teamurl     string    `json:"team_url"`
	CreateAt    time.Time `json:"created_at"`
	Forks       int       `json:"forks"`
	Openissues  int       `json:"open_issues"`
	Language    string    `json:"language"`
}

type Userinfo

type Userinfo struct {
	Userid string `yaml:"userid"`
	Token  string `yaml:"token"`
	Repo   string `yaml:"repo"`
}

Jump to

Keyboard shortcuts

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