Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptsJSON ¶
Example: "text/html, application/json;q=0.9, */*;q=0.8"
Noteworthy information: - quality values are ignored (simply checks for "application/json" presence) - wildcards (*/*) are not treated as JSON (intentionally defaults to XML for backward compatibility)
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept
func DetectProtocolVersion ¶
DetectProtocolVersion attempts to detect the protocol version from the request Supported protocol versions are implemented in version-specific packages (e.g., v3)
func IsJSONContentType ¶
Example: "application/json; charset=utf-8"
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type
func IsPingbackRequest ¶
IsPingbackRequest checks if the request body is a pingback. For now, it only checks JSON requests for an "events" field. Uses streaming token parsing for performance - avoids full unmarshal.
Types ¶
type Protocol ¶
type Protocol interface {
// GetVersion returns the protocol version string
GetVersion() string
// ParseRequest parses an update request according to this protocol version
// It returns an UpdateRequest with extensions and metadata
ParseRequest([]byte, string) (*extension.UpdateRequest, error)
// FormatUpdateResponse formats a standard update response based on content type
FormatUpdateResponse(extension.Extensions, string) ([]byte, error)
// FormatWebStoreResponse formats a web store response based on content type
FormatWebStoreResponse(extension.Extensions, string) ([]byte, error)
}
Protocol defines the interface for different Omaha protocol versions