http

package
v0.0.0-...-3c22c5d Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedConn = errors.New("use of closed network connection")

ErrClosedConn happens when listener is closing

View Source
var ErrUnexpected = errors.New("unexpected Error")

ErrUnexpected happens on unknown source error

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	User, Pass string
}

AuthRequest defines auth request

type AuthResponse

type AuthResponse struct {
	Token string
}

AuthResponse defines auth response

type Server

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

Server defines http server

func New

func New(port int, svc Service, auth service.AuthService, appName string) *Server

New instantiates http server

func (*Server) Run

func (s *Server) Run() error

Run http server

func (*Server) Terminate

func (s *Server) Terminate()

Terminate stop server

type Service

type Service interface {
	GetTopContributors(ctx context.Context, r provider.GithubTopRequest) ([]*provider.Contributor, error)
	GetTopSearchedLocations(ctx context.Context, size int) ([]*provider.Location, error)
}

Service defines application interface

type TopContributorsRequest

type TopContributorsRequest struct {
	City  string
	Size  int
	Token string
	Sort  string
	APIv  string
}

TopContributorsRequest defines api request

type TopContributorsResponse

type TopContributorsResponse struct {
	Top []*provider.Contributor
}

TopContributorsResponse defines api response

type TopSearchedLocationsRequest

type TopSearchedLocationsRequest struct {
	Size int
}

TopContributorsRequest defines api request

type TopSearchedLocationsResponse

type TopSearchedLocationsResponse struct {
	Top []*provider.Location
}

TopContributorsResponse defines api response

Jump to

Keyboard shortcuts

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