edgeevents

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInstInfo

type AppInstInfo struct {

	// hashmap containing Clients on this appinst and information about each Client
	Clients map[Client]*ClientInfo
	// contains filtered or unexported fields
}

Struct that holds information about appinst

type Client

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

Client uniquely identified by session cookie

type ClientInfo

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

Client info contains the client's specific Send function, last location, and carrier

type EdgeEventsHandlerPlugin

type EdgeEventsHandlerPlugin struct {
	util.Mutex
	// hashmap containing AppInsts on this cloudlet and information about each AppInst
	AppInsts                   map[edgeproto.AppInstKey]*AppInstInfo
	EdgeEventsCookieExpiration time.Duration
}

Implements uaemcommon.EdgeEventsHandler interface

func (*EdgeEventsHandlerPlugin) AddClient

func (e *EdgeEventsHandlerPlugin) AddClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey, lastLoc dme.Loc, carrier string, sendFunc func(event *dme.ServerEdgeEvent))

Add Client connected to specified AppInst to Map

func (*EdgeEventsHandlerPlugin) GetVersionProperties

func (e *EdgeEventsHandlerPlugin) GetVersionProperties(ctx context.Context) map[string]string

func (*EdgeEventsHandlerPlugin) ProcessLatencySamples

func (e *EdgeEventsHandlerPlugin) ProcessLatencySamples(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey, samples []*dme.Sample) (*dme.Statistics, error)

Handle processing of latency samples and then send back to client For now: Avg, Min, Max, StdDev

func (*EdgeEventsHandlerPlugin) RemoveAppInst

func (e *EdgeEventsHandlerPlugin) RemoveAppInst(ctx context.Context, appInstKey edgeproto.AppInstKey)

Remove AppInst from Map of AppInsts

func (*EdgeEventsHandlerPlugin) RemoveClient

func (e *EdgeEventsHandlerPlugin) RemoveClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey)

Remove Client connected to specified AppInst from Map

func (*EdgeEventsHandlerPlugin) SendAppInstStateEdgeEvent

func (e *EdgeEventsHandlerPlugin) SendAppInstStateEdgeEvent(ctx context.Context, appinstState *uaemcommon.DmeAppInstState, appInstKey edgeproto.AppInstKey, appKey *edgeproto.AppKey, eventType dme.ServerEdgeEvent_ServerEventType)

Send a AppInstState EdgeEvent with specified Event to all clients connected to specified AppInst (and also have initiated persistent connection)

func (*EdgeEventsHandlerPlugin) SendAvailableAppInst

func (e *EdgeEventsHandlerPlugin) SendAvailableAppInst(ctx context.Context, app *uaemcommon.DmeApp, newAppInstKey edgeproto.AppInstKey, newAppInst *uaemcommon.DmeAppInst, newAppInstCarrier string)

Send new FindCloudletReply with available appinst information to all clients that are closer to this appinst

func (*EdgeEventsHandlerPlugin) SendCloudletMaintenanceStateEdgeEvent

func (e *EdgeEventsHandlerPlugin) SendCloudletMaintenanceStateEdgeEvent(ctx context.Context, appinstState *uaemcommon.DmeAppInstState, cloudletKey edgeproto.CloudletKey)

func (*EdgeEventsHandlerPlugin) SendCloudletStateEdgeEvent

func (e *EdgeEventsHandlerPlugin) SendCloudletStateEdgeEvent(ctx context.Context, appinstState *uaemcommon.DmeAppInstState, cloudletKey edgeproto.CloudletKey)

func (*EdgeEventsHandlerPlugin) SendEdgeEventToClient

func (e *EdgeEventsHandlerPlugin) SendEdgeEventToClient(ctx context.Context, serverEdgeEvent *dme.ServerEdgeEvent, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey)

Send ServerEdgeEvent to specified client via persistent grpc stream

func (*EdgeEventsHandlerPlugin) SendLatencyRequestEdgeEvent

func (e *EdgeEventsHandlerPlugin) SendLatencyRequestEdgeEvent(ctx context.Context, appInstKey edgeproto.AppInstKey)

Send a ServerEdgeEvent with Latency Request Event to all clients connected to specified AppInst (and also have an initiated persistent connection) When client receives this event, it will measure latency from itself to appinst and back. Client will then send those latency samples back to be processed in the HandleLatencySamples function Finally, DME will send the processed latency samples in the form of dme.Latency struct (with calculated avg, min, max, stddev) back to client

func (*EdgeEventsHandlerPlugin) UpdateClientCarrier

func (e *EdgeEventsHandlerPlugin) UpdateClientCarrier(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey, carrier string)

func (*EdgeEventsHandlerPlugin) UpdateClientLastLocation

func (e *EdgeEventsHandlerPlugin) UpdateClientLastLocation(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey uaemcommon.CookieKey, lastLoc dme.Loc)

Update Client's last location

type Usability

type Usability int
const (
	Unusable Usability = iota
	Usable
)

Jump to

Keyboard shortcuts

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