gosrsbox

package module
v0.0.0-...-2a4d795 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

gosrsbox is a client library for osrsbox-api utilizing OpenAPI automation.

Installing

go get github.com/atye/gosrsbox

Creating a client

api := gosrsbox.NewAPI("my user agent")

Features (See examples folder for examples)

  • get Items, Monsters, and Prayers by id, wiki name, built-in options, and custom queries
  • supports MongoDB and Python queries as documented on osrsbox-api
  • get any document from the Static JSON API (good for dumping the database)

About

Item, Monster, and Prayer models are generated via a modified OpenAPI specification with the original being https://api.osrsbox.com/api-docs. The real API responses don't quite align with the original specification so some things are modified:

  • The _id property is removed as it conflicts with the id property.
  • The id property is a string, not an integer; except for the MonsterDrop model.
  • The page in the response meta is an integer, not a string.

Concurrent requests to the API server is limited to 10 so that the API server is not overloaded with queries that return multiple pages.

I do my best to make sure the client is up to date with API but if something isn't correct, please open an issue.

Documentation

Overview

Query Items, Monsters, and Prayers from the RESTful osrsbox-api project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(userAgent string, opts ...Option) osrsboxapi.API

NewAPI returns a osrsboxapi client.

Types

type Option

type Option func(c *client.APIClient) *client.APIClient

Option to configure the client

func WithTracing

func WithTracing(url string, probablity float64) Option

WithTracing enables Zipkin tracing. Pass in the collector URL and a probablity to export traces

Directories

Path Synopsis
internal
client/common/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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