broker

package
v0.0.0-...-aa8370d Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 22 Imported by: 3

Documentation

Overview

Edge server client - edge server is a client of edge node subscribing images

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongNode     = errors.New("Trying to subscribe to wrong edge node")
	ErrNotRegistered = errors.New("Edge node not registered")
	ErrRegistered    = errors.New("Edge node already registered")
	ErrUnsubscribe   = errors.New("Unsubscribe failed")
	ErrLoadCert      = errors.New("Certificate loading error")
	ErrConnect       = errors.New("Could not connect to server")
)
View Source
var ActController = flag.String("c", "0", "a string")

to enable latency controller

View Source
var BrokerRestart = flag.String("r", "0", "a string")

to enable restart of brokers

View Source
var StorePath = flag.String("p", "../../def_store/", "a string")

to enable persistence

Functions

This section is empty.

Types

type Authentication

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

Authentication holds the login/password

func (*Authentication) GetRequestMetadata

func (a *Authentication) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

GetRequestMetadata gets the current request metadata

func (*Authentication) RequireTransportSecurity

func (a *Authentication) RequireTransportSecurity() bool

RequireTransportSecurity indicates whether the credentials requires transport security

type EdgeNodeBroker

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

func NewEdgeNodeBroker

func NewEdgeNodeBroker(sname, ipaddr, actController, storePath, brokerRestart string) *EdgeNodeBroker

func (*EdgeNodeBroker) Connect

func (s *EdgeNodeBroker) Connect(ctx context.Context, url *edgenode.Url) (*edgenode.Id, error)

************ Begin RPCs ************* Connect API returns id assigned by Mez

func (*EdgeNodeBroker) LatencyCalc

func (*EdgeNodeBroker) Publish

Publish only supported by Edge node brokers

func (*EdgeNodeBroker) StartEdgeNodeBroker

func (s *EdgeNodeBroker) StartEdgeNodeBroker(edgeServerIpaddr, login, password string) error

func (*EdgeNodeBroker) Subscribe

Subscribe supported by both Edge server and Edge node brokers. However their implementation is different Edge node subscription interacts with the controller to produce a stream that satisfies the requested latency accuracy

func (*EdgeNodeBroker) UnaryInterceptor

func (s *EdgeNodeBroker) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

unaryInterceptor calls authenticateClient with current context

func (*EdgeNodeBroker) Unsubscribe

func (s *EdgeNodeBroker) Unsubscribe(ctx context.Context, caminfo *edgenode.CameraInfo) (*edgenode.Status, error)

type EdgeNodeClient

type EdgeNodeClient struct {
	Auth Authentication
}

func NewEdgeNodeClient

func NewEdgeNodeClient(login, password string) *EdgeNodeClient

func (*EdgeNodeClient) Register

func (cc *EdgeNodeClient) Register(ipaddr string, camid string, client edgeserver.PubSubClient) error

type EdgeServerBroker

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

func NewEdgeServerBroker

func NewEdgeServerBroker(sname, ipaddr, actController, storePath, brokerRestart string) *EdgeServerBroker

func (*EdgeServerBroker) Connect

func (s *EdgeServerBroker) Connect(ctx context.Context, url *edgeserver.Url) (*edgeserver.Id, error)

************ Begin RPCs ************* Connect API returns id assigned by Mez

func (*EdgeServerBroker) GetCameraInfo

Called by consumer application

func (*EdgeServerBroker) Register

func (s *EdgeServerBroker) Register(ctx context.Context, nodeinfo *edgeserver.NodeInfo) (*edgeserver.Status, error)

Called by Edge node

func (*EdgeServerBroker) StartEdgeServerBroker

func (s *EdgeServerBroker) StartEdgeServerBroker()

func (*EdgeServerBroker) Subscribe

Called by consumer application

func (*EdgeServerBroker) UnaryInterceptor

func (s *EdgeServerBroker) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

unaryInterceptor calls authenticateClient with current context

func (*EdgeServerBroker) Unregister

func (s *EdgeServerBroker) Unregister(ctx context.Context, nodeinfo *edgeserver.NodeInfo) (*edgeserver.Status, error)

Called by Edge node

func (*EdgeServerBroker) Unsubscribe

func (s *EdgeServerBroker) Unsubscribe(ctx context.Context, appinfo *edgeserver.AppInfo) (*edgeserver.Status, error)

type EdgeServerClient

type EdgeServerClient struct {
	Auth Authentication
}

func NewEdgeServerClient

func NewEdgeServerClient(login, password string) *EdgeServerClient

func (*EdgeServerClient) SubscribeImage

func (cc *EdgeServerClient) SubscribeImage(s *EdgeServerBroker, client edgenode.PubSubClient, impars *edgeserver.ImageStreamParameters, c chan<- bool) error

type EdgeServerClientWithControl

type EdgeServerClientWithControl struct {
	Auth Authentication
	// contains filtered or unexported fields
}

func NewEdgeServerClientWithControl

func NewEdgeServerClientWithControl(login, password string) *EdgeServerClientWithControl

func (*EdgeServerClientWithControl) SubscribeImage

Jump to

Keyboard shortcuts

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