api

package module
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: BSD-3-Clause Imports: 11 Imported by: 3

README

go-brooklynintegers-api

Go package for the Brooklyn Integers API.

Documentation

Documentation is incomplete at this time.

Usage

Simple

package main

import (
	"fmt"
	"github.com/aaronland/go-brooklynintegers-api"
)

func main() {

	client := api.NewAPIClient()
	i, _ := client.CreateInteger()

	fmt.Println(i)
}

Less simple

import (
       "fmt"
       "github.com/aaronland/go-brooklynintegers-api"
)

func main() {

	client := api.NewAPIClient()

	params := url.Values{}
	method := "brooklyn.integers.create"

	rsp, _ := client.ExecuteMethod(method, &params)
	i, _ := rsp.Int()

	fmt.Println(i)
}

Tools

int

Mint one or more Brooklyn Integers.

$> ./bin/int -h
Usage of ./bin/int:
  -count int
    	The number of Brooklyn Integers to mint (default 1)
proxy-server

This tool has been moved to the go-brooklynintegers-proxy package.

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIClient

func NewAPIClient(ctx context.Context, uri string) (client.Client, error)

func RegisterClientSchemes added in v1.2.7

func RegisterClientSchemes(ctx context.Context) error

RegisterClientSchemes will explicitly register all the schemes associated with the `client.Client` interface.

Types

type APIClient

type APIClient struct {
	client.Client

	Scheme   string
	Host     string
	Endpoint string
	// contains filtered or unexported fields
}

func (*APIClient) NextInt

func (client *APIClient) NextInt(ctx context.Context) (int64, error)

type APIError

type APIError struct {
	Code    int64
	Message string
}

func (*APIError) Error

func (e *APIError) Error() string

type APIResponse

type APIResponse struct {
	// contains filtered or unexported fields
}

func (*APIResponse) Error

func (rsp *APIResponse) Error() error

func (*APIResponse) Int

func (rsp *APIResponse) Int() (int64, error)

func (*APIResponse) Ok

func (rsp *APIResponse) Ok() (bool, error)

func (*APIResponse) Stat

func (rsp *APIResponse) Stat() string

Directories

Path Synopsis
cmd
int

Jump to

Keyboard shortcuts

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