service

package
v0.0.0-...-6ae1f19 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PORT  string `yaml:"port"`
	STEP  uint64 `yaml:"step"`
	MySQL MySQL  `yaml:"mysql"`
}

func NewConfig

func NewConfig() *Config

type H

type H map[string]interface{}

type MySQL

type MySQL struct {
	User     string `yaml:"user"`
	PassWord string `yaml:"password"`
	Host     string `yaml:"host"`
	Database string `yaml:"database"`
}

type Service

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

Service is the basic information for a unique ID generator

func New

func New(conf *Config) *Service

New returns a new service that can be used to generate IDs

func (*Service) NextID

func (svr *Service) NextID() (uint64, error)

NextID creates and returns a unique ID

func (*Service) ServeHttp

func (svr *Service) ServeHttp(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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