location

package
v0.0.0-...-d7ee072 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Country       string   `json:"country"`
	CountryCodeA2 string   `json:"countryCodeA2"`
	CountryCodeA3 string   `json:"countryCodeA3"`
	Region        string   `json:"region"`
	Locality      string   `json:"locality"`
	Address       string   `json:"address"`
	Address2      string   `json:"address2"`
	Zip           string   `json:"zip"`
	AddressType   string   `json:"addressType"`
	HouseNumber   string   `json:"houseNumber"`
	PostalCode    string   `json:"postalCode"`
	PlusFour      string   `json:"plusFour"`
	Commercial    bool     `json:"commercial"`
	Predirection  string   `json:"predirection"`
	District      string   `json:"district"`
	Street        string   `json:"street"`
	Latitude      *float64 `json:"latitude"`
	Longitude     *float64 `json:"longitude"`
	TimeZone      string   `json:"timeZone"`
	UtcOffset     *float64 `json:"utcOffset"`
}

type LocationEventHandler

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

func NewLocationEventHandler

func NewLocationEventHandler(services *service.Services, log logger.Logger, cfg *config.Config, grpcClients *grpc_client.Clients) *LocationEventHandler

func (*LocationEventHandler) ExtractAndEnrichLocation

func (h *LocationEventHandler) ExtractAndEnrichLocation(ctx context.Context, tenant, address string) (*Location, error)

func (*LocationEventHandler) OnLocationCreate

func (h *LocationEventHandler) OnLocationCreate(ctx context.Context, evt eventstore.Event) error

type LocationValidateRequest

type LocationValidateRequest struct {
	Address       string `json:"address" validate:"required"`
	Country       string `json:"country"`
	International bool   `json:"international"`
}

type LocationValidationResponseV1

type LocationValidationResponseV1 struct {
	Address *ValidatedAddress `json:"address"`
	Valid   bool              `json:"valid"`
	Error   *string           `json:"error"`
}

type LocationValidationSubscriber

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

func NewLocationValidationSubscriber

func NewLocationValidationSubscriber(log logger.Logger, db *esdb.Client, cfg *config.Config, services *service.Services, grpcClients *grpc_client.Clients) *LocationValidationSubscriber

func (*LocationValidationSubscriber) Connect

func (*LocationValidationSubscriber) ProcessEvents

func (s *LocationValidationSubscriber) ProcessEvents(ctx context.Context, sub *esdb.PersistentSubscription, workerID int) error

func (*LocationValidationSubscriber) When

type ValidatedAddress

type ValidatedAddress struct {
	Country      string   `json:"country"`
	Region       string   `json:"region"`
	District     string   `json:"district"`
	Locality     string   `json:"locality"`
	Street       string   `json:"street"`
	Zip          string   `json:"zip"`
	PostalCode   string   `json:"postalCode"`
	AddressLine1 string   `json:"addressLine1"`
	AddressLine2 string   `json:"addressLine2"`
	AddressType  string   `json:"addressType"`
	HouseNumber  string   `json:"houseNumber"`
	PlusFour     string   `json:"plusFour"`
	Commercial   bool     `json:"commercial"`
	Predirection string   `json:"predirection"`
	Latitude     *float64 `json:"latitude"`
	Longitude    *float64 `json:"longitude"`
	TimeZone     string   `json:"timeZone"`
	UtcOffset    int      `json:"utcOffset"`
}

Jump to

Keyboard shortcuts

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