service

package
v0.0.0-...-d67adc9 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventAlreadyExists = fmt.Errorf("event with this ID already exists")
)
View Source
var (
	ErrLocationUnknown = fmt.Errorf("unable to determine location")
)

Functions

This section is empty.

Types

type Event

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

func NewEvent

func NewEvent(eventRepository repository.IEvent, geoIP IGeoIP) *Event

func (*Event) AddEvent

func (e *Event) AddEvent(req *request.PostEvent) (*response.PostEvent, error)

type EventMock

type EventMock struct {
	mock.Mock
}

func (*EventMock) AddEvent

func (m *EventMock) AddEvent(req *request.PostEvent) (*response.PostEvent, error)

type EventWithLocation

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

type GeoIP

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

func NewGeoIP

func NewGeoIP(path string) (*GeoIP, error)

func (*GeoIP) Close

func (s *GeoIP) Close() error

func (*GeoIP) LocationByIP

func (s *GeoIP) LocationByIP(ip net.IP) (*Location, error)

type GeoIPMock

type GeoIPMock struct {
	mock.Mock
}

func (*GeoIPMock) LocationByIP

func (m *GeoIPMock) LocationByIP(ip net.IP) (*Location, error)

type IEvent

type IEvent interface {
	AddEvent(*request.PostEvent) (*response.PostEvent, error)
}

type IGeoIP

type IGeoIP interface {
	LocationByIP(net.IP) (*Location, error)
}

type Location

type Location struct {
	AccuracyRadius uint16
	Latitude       float64
	Longitude      float64
}

Jump to

Keyboard shortcuts

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