utils

package
v0.6.6 Latest Latest
Warning

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

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

Documentation

Overview

Package utils implements various gNMI path manipulation facilities.

Index

Constants

View Source
const GrpcBasePort = 5150

GrpcBasePort - the base port for trafficsim - other e2 ports are stepped from this

View Source
const ImsiBaseCbrs = types.Imsi(315010999900000)

ImsiBaseCbrs - from https://imsiadmin.com/cbrs-assignments

View Source
const ServiceName = "ran-simulator"

ServiceName is the default name of this Kubernetes service

View Source
const TestPlmnID = "315010"

TestPlmnID - https://en.wikipedia.org/wiki/Mobile_country_code#Test_networks

Variables

This section is empty.

Functions

func AspectRatio added in v0.6.1

func AspectRatio(point *types.Point) float64

AspectRatio - Compensate for the narrowing of meridians at higher latitudes

func AzimuthToRads added in v0.6.1

func AzimuthToRads(azimuth float64) float64

AzimuthToRads - angle measured in degrees clockwise from north, expressed in rads from 3 o'clock anticlockwise

func DegreesToRads added in v0.6.1

func DegreesToRads(degrees float64) float64

DegreesToRads - general conversion of degrees to rads, both starting at 3 o'clock going anticlockwise

func GetRotationDegrees

func GetRotationDegrees(pointA *types.Point, pointB *types.Point) float64

GetRotationDegrees - get the rotation of the car

func ImsiGenerator

func ImsiGenerator(ueIdx int) types.Imsi

ImsiGenerator -- generate an Imsi from an index

func ParseGNMIElements added in v0.6.5

func ParseGNMIElements(elms []string) (*pb.Path, error)

ParseGNMIElements builds up a gnmi path, from user-supplied text

func RandomColor

func RandomColor() string

RandomColor from https://htmlcolorcodes.com/

func RandomLatLng

func RandomLatLng(mapCenterLat float64, mapCenterLng float64, radius float64, aspectRatio float64) types.Point

RandomLatLng - Generates a random latlng value in 1000 meter radius of loc

func SplitPath added in v0.6.5

func SplitPath(path string) []string

SplitPath splits a gnmi path according to the spec. See https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-path-conventions.md No validation is done. Behavior is undefined if path is an invalid gnmi path. TODO: Do validation?

func SplitPaths added in v0.6.5

func SplitPaths(paths []string) [][]string

SplitPaths splits multiple gnmi paths

func StrPath added in v0.6.5

func StrPath(path *pb.Path) string

StrPath builds a human-readable form of a gnmi path. e.g. /a/b/c[e=f]

func StrPathElem added in v0.6.5

func StrPathElem(pathElem []*pb.PathElem) string

StrPathElem builds a human-readable form of a list of path elements. e.g. /a/b/c[e=f]

func StrVal added in v0.6.5

func StrVal(val *pb.TypedValue) string

StrVal will return a string representing the supplied value

Types

type ServerParams

type ServerParams struct {
	CaPath         string
	KeyPath        string
	CertPath       string
	TopoEndpoint   string
	AddK8sSvcPorts bool
}

ServerParams - params to start a new server

Jump to

Keyboard shortcuts

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