docs(forge): improve top-level usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
8473c5676f
commit
f8224ed05d
2 changed files with 5 additions and 3 deletions
6
forge.go
6
forge.go
|
|
@ -4,8 +4,9 @@ package forge
|
|||
//
|
||||
// Usage:
|
||||
//
|
||||
// ctx := context.Background()
|
||||
// f := forge.NewForge("https://forge.lthn.ai", "token")
|
||||
// _ = f.Repos
|
||||
// repo, err := f.Repos.Get(ctx, forge.Params{"owner": "core", "repo": "go-forge"})
|
||||
type Forge struct {
|
||||
client *Client
|
||||
|
||||
|
|
@ -35,8 +36,9 @@ type Forge struct {
|
|||
//
|
||||
// Usage:
|
||||
//
|
||||
// ctx := context.Background()
|
||||
// f := forge.NewForge("https://forge.lthn.ai", "token")
|
||||
// _ = f
|
||||
// repos, err := f.Repos.ListOrgRepos(ctx, "core")
|
||||
func NewForge(url, token string, opts ...Option) *Forge {
|
||||
c := NewClient(url, token, opts...)
|
||||
f := &Forge{client: c}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ type ListOptions struct {
|
|||
Limit int // items per page (default 50)
|
||||
}
|
||||
|
||||
// DefaultList returns sensible default pagination.
|
||||
// DefaultList provides sensible default pagination.
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue