Skip to content

RedsonBr140/gitea-bindings-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitea-bindings-go

gitea-bindings-go is a Go client library for accessing the Gitea API v1.

Tests

Installation

go get codeberg.org/redson/gitea-bindings-go/gitea

You can also import the package

import "codeberg.org/redson/gitea-bindings-go/gitea"

and run go get without parameters.

Usage

import "codeberg.org/redson/gitea-bindings-go/gitea"

Construct a new Client, and then you can use the services to access different parts of the API. For example:

client := gitea.NewClient(nil)
    
// get info about a repository
repo, err := client.Repositories.Get("redson", "gitea-bindings-go")
fmt.Println("Description:", repo.Description)

The default instance is Codeberg, if you want to use another, do something like:

instanceURL := url.Parse("https://gittea.dev/api/v1/")
client := gitea.NewClient(&gitea.ClientOptions{
  baseURL: instanceURL,
})

Authentication

Authentication is the same as changing the instance but now what you provide is a token, for example:

client := gitea.NewClient(&gitea.ClientOptions{
  Token: "foo",
})

For more info, see the examples.

License

This library is distributed under MIT License found in LICENSE file.

About

Go bindings for the Gitea API (read-only mirror)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

    Packages

     
     
     

    Contributors

    Languages