artisanalinteger

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: BSD-3-Clause Imports: 0 Imported by: 7

README

go-artisanal-integers

No, really.

Install

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

make tools

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

Usage

Interfaces

Client
type Client interface {
	NextInt() (int64, error)
}
Engine

An "engine" is the interface between your code and an underlying data model (typically a database) for minting artisanal integers. The interface looks like this:

type Engine interface {
	NextInt() (int64, error)
	LastInt() (int64, error)
	SetLastInt(int64) error
	SetKey(string) error
	SetOffset(int64) error
	SetIncrement(int64) error
	Close() error
}
Service
type Service interface {
	NextInt() (int64, error)
	LastInt() (int64, error)
}
Server
type Server interface {
	ListenAndServe(Service) error
}

Tools

Everything is in flux. This will be updated soon.

Engines

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NextInt() (int64, error)
}

type Engine

type Engine interface {
	NextInt() (int64, error)
	LastInt() (int64, error)
	SetLastInt(int64) error
	SetKey(string) error
	SetOffset(int64) error
	SetIncrement(int64) error
	Close() error
}

type Integer

type Integer struct {
	Integer int64 `json:"integer"`
}

type Server

type Server interface {
	ListenAndServe(Service) error
	Address() string
}

type Service

type Service interface {
	NextInt() (int64, error)
	LastInt() (int64, error)
}

Directories

Path Synopsis
cmd
int

Jump to

Keyboard shortcuts

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