postgisdb

package module
v0.0.0-...-94138d8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbHost              = "meep-postgis.default.svc.cluster.local"
	DbPort              = "5432"
	DbUser              = ""
	DbPassword          = ""
	DbDefault           = "postgres"
	DbMaxRetryCount int = 2
)

DB Config

View Source
const (
	PathModeLoop    = "LOOP"
	PathModeReverse = "REVERSE"
)

Path modes

View Source
const (
	UeTable      = "ue"
	PoaTable     = "poa"
	ComputeTable = "compute"
)

DB Table Names

View Source
const (
	TypeUe      = "UE"
	TypePoa     = "POA"
	TypeCompute = "COMPUTE"
)

Asset Types

View Source
const (
	PoaTypeGeneric = "POA"
	PoaTypeCell4g  = "POA-CELL"
	PoaTypeCell5g  = "POA-CELL-5G"
	PoaTypeWifi    = "POA-WIFI"
)

POA Types

View Source
const (
	AllAssets = "ALL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Compute

type Compute struct {
	Id       string
	Name     string
	SubType  string
	Position string
}

type Connector

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

Connector - Implements a Postgis SQL DB connector

func NewConnector

func NewConnector(name, namespace, user, pwd, host, port string) (pc *Connector, err error)

NewConnector - Creates and initializes a Postgis connector

func (*Connector) AdvanceAllUePosition

func (pc *Connector) AdvanceAllUePosition(increment float32) (err error)

AdvanceUePosition - Advance all UEs along path by provided number of increments

func (*Connector) AdvanceUePosition

func (pc *Connector) AdvanceUePosition(name string, increment float32) (err error)

AdvanceUePosition - Advance UE along path by provided number of increments

func (*Connector) CreateCompute

func (pc *Connector) CreateCompute(id string, name string, subType string, position string) (err error)

CreateCompute - Create new Compute

func (*Connector) CreateDb

func (pc *Connector) CreateDb(name string) (err error)

CreateDb -- Create new DB with provided name

func (*Connector) CreatePoa

func (pc *Connector) CreatePoa(id string, name string, subType string, position string, radius float32) (err error)

CreatePoa - Create new POA

func (*Connector) CreateTables

func (pc *Connector) CreateTables() (err error)

func (*Connector) CreateUe

func (pc *Connector) CreateUe(id string, name string, position string, path string, mode string, velocity float32) (err error)

CreateUe - Create new UE

func (*Connector) DeleteAllCompute

func (pc *Connector) DeleteAllCompute() (err error)

DeleteAllCompute - Delete all Compute entries

func (*Connector) DeleteAllPoa

func (pc *Connector) DeleteAllPoa() (err error)

DeleteAllPoa - Delete all POA entries

func (*Connector) DeleteAllUe

func (pc *Connector) DeleteAllUe() (err error)

DeleteAllUe - Delete all UE entries

func (*Connector) DeleteCompute

func (pc *Connector) DeleteCompute(name string) (err error)

DeleteCompute - Delete Compute entry

func (*Connector) DeletePoa

func (pc *Connector) DeletePoa(name string) (err error)

DeletePoa - Delete POA entry

func (*Connector) DeleteTable

func (pc *Connector) DeleteTable(tableName string) (err error)

DeleteTable - Delete postgis table with provided name

func (*Connector) DeleteTables

func (pc *Connector) DeleteTables() (err error)

DeleteTables - Delete all postgis tables

func (*Connector) DeleteUe

func (pc *Connector) DeleteUe(name string) (err error)

DeleteUe - Delete UE entry

func (*Connector) GetAllCompute

func (pc *Connector) GetAllCompute() (computeMap map[string]*Compute, err error)

GetAllCompute - Get all Compute information

func (*Connector) GetAllPoa

func (pc *Connector) GetAllPoa() (poaMap map[string]*Poa, err error)

GetAllPoa - Get all POA information

func (*Connector) GetAllUe

func (pc *Connector) GetAllUe() (ueMap map[string]*Ue, err error)

GetAllUe - Get All UE information

func (*Connector) GetCompute

func (pc *Connector) GetCompute(name string) (compute *Compute, err error)

GetCompute - Get Compute information

func (*Connector) GetPoa

func (pc *Connector) GetPoa(name string) (poa *Poa, err error)

GetPoa - Get POA information

func (*Connector) GetUe

func (pc *Connector) GetUe(name string) (ue *Ue, err error)

GetUe - Get UE information

func (*Connector) SetListener

func (pc *Connector) SetListener(listener func(string, string)) error

func (*Connector) UpdateCompute

func (pc *Connector) UpdateCompute(name string, position string) (err error)

UpdateCompute - Update existing Compute

func (*Connector) UpdatePoa

func (pc *Connector) UpdatePoa(name string, position string, radius float32) (err error)

UpdatePoa - Update existing POA

func (*Connector) UpdateUe

func (pc *Connector) UpdateUe(name string, position string, path string, mode string, velocity float32) (err error)

UpdateUe - Update existing UE

type Poa

type Poa struct {
	Id       string
	Name     string
	SubType  string
	Position string
	Radius   float32
}

type PoaInfo

type PoaInfo struct {
	Distance float32
	SubType  string
	InRange  bool
}

type Ue

type Ue struct {
	Id            string
	Name          string
	Position      string
	Path          string
	PathMode      string
	PathVelocity  float32
	PathLength    float32
	PathIncrement float32
	PathFraction  float32
	Poa           string
	PoaDistance   float32
	PoaInRange    []string
}

type UePoaInfo

type UePoaInfo struct {
	PoaInRange []string
	PoaInfoMap map[string]*PoaInfo
	CurrentPoa string
}

Jump to

Keyboard shortcuts

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