micros

package
v0.0.0-...-e168591 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadRouting is returned when an expected path variable is missing.
	ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)")
)
View Source
var ErrEmpty = errors.New("empty string")

ErrEmpty is returned when an input string is empty.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when an input string is empty.

View Source
var (
	//ErrRequestTypeNotFound err
	ErrRequestTypeNotFound = errors.New("Request type only valid for word, sentence and paragraph")
)

Functions

func MakeGetBestProxyIPEndpoint

func MakeGetBestProxyIPEndpoint(svc Service) endpoint.Endpoint

MakeGetBestProxyIPEndpoint make a endpoint

func MakeHTTPHandler

func MakeHTTPHandler(ctx context.Context, endpoint Endpoints, logger log.Logger) http.Handler

MakeHTTPHandler make http handler

func MakePostBestProxyIPEndpoint

func MakePostBestProxyIPEndpoint(svc Service) endpoint.Endpoint

MakePostBestProxyIPEndpoint make a endpoint

Types

type BestProxyIP

type BestProxyIP struct {
	Status int     `json:"status"`
	ID     string  `json:"id"`
	IP     string  `json:"ip"`
	Dur    float64 `json:"dur"`
	Err    string  `json:"err,omitempty"`
}

BestProxyIP best

type Endpoints

type Endpoints struct {
	PostBestProxyIPEndpoint endpoint.Endpoint
	GetBestProxyIPEndpoint  endpoint.Endpoint
}

Endpoints endpoint module

type ProxyIPService

type ProxyIPService struct {
}

ProxyIPService type

func (ProxyIPService) GetBestProxyIP

func (ProxyIPService) GetBestProxyIP(ctx context.Context, id string) (*BestProxyIP, error)

GetBestProxyIP ., error)

func (ProxyIPService) PostBestProxyIP

func (ProxyIPService) PostBestProxyIP(ctx context.Context, b BestProxyIP) error

PostBestProxyIP Implemented

type Service

type Service interface {
	PostBestProxyIP(ctx context.Context, b BestProxyIP) error
	GetBestProxyIP(ctx context.Context, id string) (*BestProxyIP, error)
}

Service picker the best proxy ip from proxypool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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