service

package
v0.0.0-...-0ba4654 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecord = errors.New("query a not existed record")
)

Functions

func Beat

func Beat(req BeatReq, resp *BeatResp) error

Beat used to check rpc service

func GetMapVector

func GetMapVector(mapID uint, apList []*locate.APInfo) model.APVector

func InitAPConvertor

func InitAPConvertor(markAP []string)

func RunDefaultServer

func RunDefaultServer(cfg Config)

RunDefaultServer help you run default rpc server for the service

Types

type BeatReq

type BeatReq struct{}

type BeatResp

type BeatResp struct{}

type Client

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

func DefaultClient

func DefaultClient() *Client

DefaultClient to process rpc call

func NewClient

func NewClient(address string) *Client

DefaultClient to process rpc call

func (Client) Beat

func (c Client) Beat() error

func (Client) Close

func (c Client) Close() error

Close client rpc connection

func (Client) Collect

func (c Client) Collect(req CollectReq, resp *CollectResp) error

func (Client) CreateMap

func (c Client) CreateMap(req CreateMapReq, resp *CreateMapResp) error

func (Client) Locate

func (c Client) Locate(req LocateReq, resp *locate.LocationInfo) error

Locate your location by the wifi scan list

type CollectReq

type CollectReq struct {
	MapID    uint
	APList   []*locate.APInfo
	Location locate.LocationInfo
}

type CollectResp

type CollectResp struct{}

type Config

type Config struct {
	LogPath  string
	TargetAP []string
}

Config let you costom your service

type CreateMapReq

type CreateMapReq struct {
	Name   string
	Path   string
	Width  int64
	Height int64
}

type CreateMapResp

type CreateMapResp struct {
	MapID uint
}

type LocateReq

type LocateReq struct {
	MapID  uint
	APList []*locate.APInfo
}

type LocateService

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

func NewLocateService

func NewLocateService(locator locate.Locator) *LocateService

func (LocateService) Collect

func (LocateService) Collect(req CollectReq, resp *CollectResp) error

Collect APInfo prepare to locate device online

func (LocateService) CreateMap

func (LocateService) CreateMap(req CreateMapReq, resp *CreateMapResp) error

CreateMap

func (*LocateService) Locate

func (l *LocateService) Locate(req LocateReq, location *locate.LocationInfo) error

Locate compute the location of report WLAN scanList.

Jump to

Keyboard shortcuts

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