gitea-bindings-go

module
v0.0.0-...-614dcdd Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT

README

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.

Directories

Path Synopsis
Package gitea provides Go bindings for the Gitea API.
Package gitea provides Go bindings for the Gitea API.

Jump to

Keyboard shortcuts

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