本文整理汇总了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
}