haivision

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AUTH
	SESSION     = "/api/session"
	DEVICE_INFO = "/api/devices"
	// ROUTES
	LIST_ROUTES         = "/api/gateway/%s/routes"
	CREATE_ROUTE        = "/api/devices/%s/updates"
	ROUTE_COMMMAND      = "/api/devices/%s/commands"
	ROUTE_CONFIGURATION = "/api/gateway/%s/routes/%s"
	// STATS
	ROUTES_STATISTICS = "/api/gateway/%s/statistics"
)

Variables

View Source
var (
	//
	GET_LIST_OF_ROUTES = func(deviceId string) string {
		return fmt.Sprintf(LIST_ROUTES, deviceId)
	}
	//
	POST_CREATE_ROUTE = func(deviceId string) string {
		return fmt.Sprintf(CREATE_ROUTE, deviceId)
	}
	//
	GET_ROUTES_STATISTICS = func(deviceId string) string {
		return fmt.Sprintf(ROUTES_STATISTICS, deviceId)
	}
	//
	GET_ROUTE_CONFIGURATION = func(deviceId string, routeId string) string {
		return fmt.Sprintf(ROUTE_CONFIGURATION, deviceId, routeId)
	}
)

Functions

This section is empty.

Types

type HeaderConfigurator

type HeaderConfigurator struct {
	Headers map[string]string
}

func InitHeaderConfigurator

func InitHeaderConfigurator() *HeaderConfigurator

func (*HeaderConfigurator) CreateBasicAuthHeader

func (h *HeaderConfigurator) CreateBasicAuthHeader(username string, password string)

Authorization Stuff

func (*HeaderConfigurator) CreateBasicAuthHeaderEncoded

func (h *HeaderConfigurator) CreateBasicAuthHeaderEncoded(base64EncodedToken string)

func (*HeaderConfigurator) DeleteHeader

func (h *HeaderConfigurator) DeleteHeader(key string)

func (*HeaderConfigurator) DeleteHeaders

func (h *HeaderConfigurator) DeleteHeaders()

func (*HeaderConfigurator) GetHeader

func (h *HeaderConfigurator) GetHeader(key string) *string

func (*HeaderConfigurator) GetHeaderKeyValuePairs

func (h *HeaderConfigurator) GetHeaderKeyValuePairs() map[string]string

func (*HeaderConfigurator) GetHeaderKeys

func (h *HeaderConfigurator) GetHeaderKeys() []string

func (*HeaderConfigurator) GetHeaderValues

func (h *HeaderConfigurator) GetHeaderValues() []string

func (*HeaderConfigurator) GetHeaders

func (h *HeaderConfigurator) GetHeaders() map[string]string

func (*HeaderConfigurator) HasHeader

func (h *HeaderConfigurator) HasHeader(key string) bool

func (*HeaderConfigurator) HasHeaders

func (h *HeaderConfigurator) HasHeaders() bool

func (*HeaderConfigurator) SetHeader

func (h *HeaderConfigurator) SetHeader(key string, value string)

func (*HeaderConfigurator) SetHeaders

func (h *HeaderConfigurator) SetHeaders(headers map[string]string)

type IHaivisionClient

type IHaivisionClient interface {
	//
	HealthCheck() error
	IsDebug() bool
	GetDeviceID() string
	GetHType() string
	// auth stuff
	InitSession(username string, password string) (*session.BaseResponseInitSession, error)
	GetSessionInfo() (*session.ResponseSessionInfo, error)
	GetDeviceInfo() (*[]device.ResponseDeviceInfo, error)
	// Streaming
	//GetRoutes(deviceId string) (*route.ResponseRoutes, error)
	GetRoutes(deviceId string) (*resty.Response, error)
	/*GetRoutesSrt(deviceId string) (*route.ResponseRoutes[srt.RequestSourceModelSRT, srt.RequestDestinationModelSrt], error)
	GetRoutesRtmp(deviceId string) (*route.ResponseRoutes[rtmp.RequestSourceModelRTMP, rtmp.RequestDestinationModelRtmp], error)
	GetRoutesRtsp(deviceId string) (*route.ResponseRoutes[rtsp.RequestSourceModelRTSP, rtsp.RequestDestinationModelRtsp], error)
	GetRoutesUdpRtp(deviceId string) (*route.ResponseRoutes[udprtp.RequestSourceModelUdpRtp, udprtp.RequestDestinationModelUdpRtp], error)*/
	//
	GetRouteConfiguration(deviceId string, routeId string) (*resty.Response, error) // *route.RouteModel[route.RequestSource, route.RequestDestination]
	// CreateRoute() error
	CreateRouteSrt(deviceId string, rBody *route.RouteModel[srt.RequestSourceModelSRT, srt.RequestDestinationModelSrt]) (*route.ResponseCreateRoute, error)
	CreateRouteRtmp(deviceId string, rBody *route.RouteModel[rtmp.RequestSourceModelRTMP, rtmp.RequestDestinationModelRtmp]) (*route.ResponseCreateRoute, error)
	CreateRouteRtsp(deviceId string, rBody *route.RouteModel[rtsp.RequestSourceModelRTSP, rtsp.RequestDestinationModelRtsp]) (*route.ResponseCreateRoute, error)
	CreateRouteUdpRtp(deviceId string, rBody *route.RouteModel[udprtp.RequestSourceModelUdpRtp, udprtp.RequestDestinationModelUdpRtp]) (*route.ResponseCreateRoute, error)
	//
	StartOrStopRoute(deviceId string, routeId string, command string) (*route.ResponseStartOrRoute, error)
	//
	GetRouteStatistics(deviceId string, routeId string) (*stats.ResponseRouteStatistics, error)
	GetSourceStatistics(deviceId string, routeId string, sourceId string) (*stats.ResponseSourceStatistics, error)
	GetDestinationStatisticsById(deviceId string, routeId string, destinationID string) (*stats.ResponseDestinationStatistics, error)
	GetDestinationStatisticsByName(deviceId string, routeId string, destinationName string) (*stats.ResponseDestinationStatistics, error)
	GetSrtClientStatistics(deviceId string, routeId string, destinationID string, clientAddress string, clientPort string) (*stats.ResponseSrtClientStatistics, error)
}

func BuildHaivision

func BuildHaivision(url string, debug bool, username string, password string, header *HeaderConfigurator, insecure *bool) (IHaivisionClient, error)

Builder is used to build a new haivision client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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