api

package
v0.0.0-...-ad8a220 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHTTPError

func SendHTTPError(w http.ResponseWriter, errMessage string, statusCode int) error

func SendHTTPMessage

func SendHTTPMessage(writer http.ResponseWriter, object interface{}, statusCode int) error

Types

type Error

type Error struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type Server

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

func New

func New(log *zerolog.Logger, db *geoip2.Reader) *Server

func (*Server) GetIpLocationInfo

func (s *Server) GetIpLocationInfo(ipStr string) (*geoip2.City, error)

func (*Server) Routes

func (s *Server) Routes() chi.Router

Jump to

Keyboard shortcuts

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