api

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: BSD-2-Clause Imports: 8 Imported by: 1

README

go-londonintegers-api

Go package for the London Integers API.

Install

You will need to have both Go and the make programs installed on your computer. Assuming you do just type:

make bin

All of this package's dependencies are bundled with the code in the vendor directory.

Usage

Simple

package main

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

func main() {

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

	fmt.Println(i)
}

Tools

int

Mint one or more London Integers.

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

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIClient

func NewAPIClient() artisanalinteger.Client

Types

type APIClient

type APIClient struct {
	artisanalinteger.Client
	LondonIntegersClient // see above

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

func (*APIClient) ExecuteMethod

func (client *APIClient) ExecuteMethod(method string, params *url.Values) (*APIResponse, error)

func (*APIClient) NextInt

func (client *APIClient) NextInt() (int64, error)

type APIResponse

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

func (*APIResponse) Int

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

func (*APIResponse) Ok

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

type LondonIntegersClient

type LondonIntegersClient interface {
	ExecuteMethod(string, *url.Values) (*APIResponse, error)
}

Directories

Path Synopsis
cmd
int

Jump to

Keyboard shortcuts

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