crow-go/

directory
v5.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0, Apache-2.0

README

crow-go

import (
  "codefloe.com/crowci/crow/v5/crow-go/crow"
  "golang.org/x/oauth2"
)

const (
  token = "dummyToken"
  host  = "http://crow.company.tld"
)

func main() {
  // create an http client with oauth authentication.
  config := new(oauth2.Config)
  authenticator := config.Client(
    oauth2.NoContext,
    &oauth2.Token{
      AccessToken: token,
    },
  )

  // create the crow client with authenticator
  client := crow.NewClient(host, authenticator)

  // gets the current user
  user, err := client.Self()
  fmt.Println(user, err)

  // gets the named repository information
  repo, err := client.RepoLookup("crow-ci/crow")
  fmt.Println(repo, err)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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