Giter Club home page Giter Club logo

go-backstage's Introduction

go-backstage

CI codecov Go Reference

go-backstage is a Go client library for accessing the Backstage REST API.

The library provides a convenient and easy-to-use interface to access and manipulate data from the Backstage. This library handles the low-level details of making HTTP requests and parsing responses, allowing developers to focus on building their application logic.

Installation

With Go installed, run the following to add the package to your project, along with its dependencies:

go get github.com/tdabasinskas/go-backstage/v2

Alternatively, you can add import the package as following and run go get to install it:

import "github.com/tdabasinskas/go-backstage/v2"

Usage

Add the package to your project as following:

import "github.com/tdabasinskas/go-backstage/v2"

Once imported, create a new Backstage API client to access different parts of Backstage API:

client, err := backstage.NewClient(baseURL, "default", nil)

If you want to use a custom HTTP client (for example, to handle authentication, retries or different timeouts), you can pass it as the third argument:

httpClient := &http.Client{}
client, err := backstage.NewClient(baseURL, "default", httpClient)

The client than can be used to access different parts of the API, e.g. get the list of entities, sorted in specific order:

entities, response, err := c.Catalog.Entities.s.List(context.Background(), &ListEntityOptions{
        Filters: []string{},
        Fields:  []string{},
        Order:   []ListEntityOrder{{ Direction: OrderDescending, Field: "metadata.name" },
    },
})

Refer to examples directory for more examples.

Contributing

Contributions to the project are welcome. If you are interested in making a contribution, please review open issues or open a new issue to propose a new feature or bug fix. Please ensure to follow the code of conduct. Any contributions that align with the project goals and vision are appreciated. Thank you for your interest in improving the project.

License

This library is distributed under the Apache 2.0 license found in the LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.