soap

package
v0.0.0-...-f408f9e Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package soap provides SOAP request handling for the ONVIF server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeAction

func NormalizeAction(action string) string

NormalizeAction normalizes SOAP action names.

func ParseRequest

func ParseRequest(bodyContent, target interface{}) error

ParseRequest parses a SOAP request into a specific structure.

Types

type Date

type Date struct {
	Year  int `xml:"Year"`
	Month int `xml:"Month"`
	Day   int `xml:"Day"`
}

Date represents date components.

type DateTime

type DateTime struct {
	Time Time `xml:"Time"`
	Date Date `xml:"Date"`
}

DateTime represents date and time.

func ToDateTime

func ToDateTime(t time.Time) DateTime

ToDateTime converts time.Time to DateTime structure.

type GetCapabilitiesRequest

type GetCapabilitiesRequest struct {
	XMLName  xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetCapabilities"`
	Category []string `xml:"Category,omitempty"`
}

GetCapabilitiesRequest represents GetCapabilities request.

type GetDeviceInformationRequest

type GetDeviceInformationRequest struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetDeviceInformation"`
}

GetDeviceInformationRequest represents GetDeviceInformation request.

type GetProfilesRequest

type GetProfilesRequest struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetProfiles"`
}

GetProfilesRequest represents GetProfiles request.

type GetServicesRequest

type GetServicesRequest struct {
	XMLName           xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetServices"`
	IncludeCapability bool     `xml:"IncludeCapability"`
}

GetServicesRequest represents GetServices request.

type GetSnapshotURIRequest

type GetSnapshotURIRequest struct {
	XMLName      xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetSnapshotURI"`
	ProfileToken string   `xml:"ProfileToken"`
}

GetSnapshotURIRequest represents GetSnapshotURI request.

type GetStreamURIRequest

type GetStreamURIRequest struct {
	XMLName      xml.Name    `xml:"http://www.onvif.org/ver10/media/wsdl GetStreamURI"`
	StreamSetup  StreamSetup `xml:"StreamSetup"`
	ProfileToken string      `xml:"ProfileToken"`
}

GetStreamURIRequest represents GetStreamURI request.

type GetSystemDateAndTimeRequest

type GetSystemDateAndTimeRequest struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetSystemDateAndTime"`
}

GetSystemDateAndTimeRequest represents GetSystemDateAndTime request.

type GetSystemDateAndTimeResponse

type GetSystemDateAndTimeResponse struct {
	XMLName           xml.Name          `xml:"http://www.onvif.org/ver10/device/wsdl GetSystemDateAndTimeResponse"`
	SystemDateAndTime SystemDateAndTime `xml:"SystemDateAndTime"`
}

GetSystemDateAndTimeResponse represents GetSystemDateAndTime response.

type Handler

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

Handler handles incoming SOAP requests.

func NewHandler

func NewHandler(username, password string) *Handler

NewHandler creates a new SOAP handler.

func (*Handler) RegisterHandler

func (h *Handler) RegisterHandler(action string, handler MessageHandler)

RegisterHandler registers a handler for a specific action/message type.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler interface.

type MessageHandler

type MessageHandler func(body interface{}) (interface{}, error)

MessageHandler is a function that handles a specific SOAP message.

type RequestWrapper

type RequestWrapper struct {
	XMLName xml.Name
	Content []byte `xml:",innerxml"`
}

RequestWrapper wraps incoming SOAP request structures.

type StreamSetup

type StreamSetup struct {
	Stream    string    `xml:"Stream"`
	Transport Transport `xml:"Transport"`
}

StreamSetup represents stream setup parameters.

type SystemDateAndTime

type SystemDateAndTime struct {
	DateTimeType    string   `xml:"DateTimeType"`
	DaylightSavings bool     `xml:"DaylightSavings"`
	TimeZone        TimeZone `xml:"TimeZone,omitempty"`
	UTCDateTime     DateTime `xml:"UTCDateTime,omitempty"`
	LocalDateTime   DateTime `xml:"LocalDateTime,omitempty"`
}

SystemDateAndTime represents system date and time.

type Time

type Time struct {
	Hour   int `xml:"Hour"`
	Minute int `xml:"Minute"`
	Second int `xml:"Second"`
}

Time represents time components.

type TimeZone

type TimeZone struct {
	TZ string `xml:"TZ"`
}

TimeZone represents timezone information.

type Transport

type Transport struct {
	Protocol string `xml:"Protocol"`
}

Transport represents transport parameters.

Jump to

Keyboard shortcuts

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