本文整理匯總了Golang中github.com/crosbymichael/octokat.Client.WithToken方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.WithToken方法的具體用法?Golang Client.WithToken怎麽用?Golang Client.WithToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/crosbymichael/octokat.Client
的用法示例。
在下文中一共展示了Client.WithToken方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewMaintainerManager
func NewMaintainerManager(client *gh.Client, org, repo string) (*MaintainerManager, error) {
config, err := LoadConfig()
if err == nil {
client.WithToken(config.Token)
}
originPath, err := getOriginPath(repo)
if err != nil {
return nil, err
}
email, err := GetMaintainerManagerEmail()
if err != nil {
return nil, err
}
err = createMaintainerManagersDirectoriesMap(originPath, "", email, config.UserName)
if err != nil {
return nil, err
}
return &MaintainerManager{
repo: gh.Repo{Name: repo, UserName: org},
client: client,
maintainerDirMap: &maintainerDirMap,
email: email,
maintainersIds: &maintainersIds,
maintainersDirMap: &maintainersDirMap,
}, nil
}
示例2: NewMaintainer
func NewMaintainer(client *gh.Client, org, repo string) (*Maintainer, error) {
config, err := LoadConfig()
if err == nil {
client.WithToken(config.Token)
}
return &Maintainer{
repo: gh.Repo{Name: repo, UserName: org},
client: client,
}, nil
}
示例3: NewMaintainerManager
func NewMaintainerManager(client *gh.Client, org, repo string) (*MaintainerManager, error) {
config, err := LoadConfig()
if err == nil {
client.WithToken(config.Token)
}
originPath, err := getOriginPath(repo)
if err != nil {
return nil, fmt.Errorf("getoriginpath: %v", err)
}
email, err := GetMaintainerManagerEmail()
if err != nil {
return nil, fmt.Errorf("getemail: %v", err)
}
return &MaintainerManager{
repo: gh.Repo{Name: repo, UserName: org},
client: client,
email: email,
originPath: originPath,
username: config.UserName,
}, nil
}