Documentation
¶
Index ¶
- Constants
- func CheckVideoEndpoint(ctx context.Context, mediaURL string, cfg VideoGuidance) error
- func CheckVideoMetadata(mimeType string, mediaURL string, cfg VideoGuidance) error
- func IsVideoMIME(value string) bool
- func NormalizePolicy(cfg *PolicyConfig)
- func NormalizeVideoGuidance(cfg *VideoGuidance)
- func ValidatePolicy(prefix string, cfg PolicyConfig) error
- func ValidateVideoGuidance(prefix string, cfg VideoGuidance) error
- type Metrics
- type PolicyConfig
- type VideoGuidance
- type VideoMetadataPolicy
- type Violation
Constants ¶
View Source
const ( DefaultVideoLivenessTimeoutMS = 2000 VideoPolicyWarn = "warn" VideoPolicyReject = "reject" )
Variables ¶
This section is empty.
Functions ¶
func CheckVideoEndpoint ¶
func CheckVideoEndpoint(ctx context.Context, mediaURL string, cfg VideoGuidance) error
func CheckVideoMetadata ¶
func CheckVideoMetadata(mimeType string, mediaURL string, cfg VideoGuidance) error
func IsVideoMIME ¶
func NormalizePolicy ¶
func NormalizePolicy(cfg *PolicyConfig)
func NormalizeVideoGuidance ¶
func NormalizeVideoGuidance(cfg *VideoGuidance)
func ValidatePolicy ¶
func ValidatePolicy(prefix string, cfg PolicyConfig) error
func ValidateVideoGuidance ¶
func ValidateVideoGuidance(prefix string, cfg VideoGuidance) error
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) NodeVideoLivenessCheck ¶
func (m *Metrics) NodeVideoLivenessCheck()
func (*Metrics) NodeVideoLivenessFailure ¶
func (m *Metrics) NodeVideoLivenessFailure()
func (*Metrics) VideoMetadataCheck ¶
func (m *Metrics) VideoMetadataCheck()
func (*Metrics) VideoMetadataFailure ¶
func (m *Metrics) VideoMetadataFailure()
func (*Metrics) WriteMetrics ¶
type PolicyConfig ¶
type PolicyConfig struct {
Video VideoMetadataPolicy `yaml:"video"`
}
type VideoGuidance ¶
type VideoGuidance struct {
LivenessCheckEnabled bool `yaml:"liveness_check_enabled"`
LivenessTimeoutMS int `yaml:"liveness_timeout_ms"`
ExpectedTransport string `yaml:"expected_transport"`
ExpectedCodec string `yaml:"expected_codec"`
ExpectedContainer string `yaml:"expected_container"`
ExpectedWidth int `yaml:"expected_width"`
ExpectedHeight int `yaml:"expected_height"`
ExpectedFrameRateFPS int `yaml:"expected_frame_rate_fps"`
BitrateMinBPS int64 `yaml:"bitrate_min_bps"`
BitrateMaxBPS int64 `yaml:"bitrate_max_bps"`
RequireProgressive bool `yaml:"require_progressive"`
AllowedSchemes []string `yaml:"allowed_schemes"`
AllowedMIMETypes []string `yaml:"allowed_mime_types"`
}
func DefaultVideoGuidance ¶
func DefaultVideoGuidance() VideoGuidance
type VideoMetadataPolicy ¶
type VideoMetadataPolicy struct {
Enabled bool `yaml:"enabled"`
Enforcement string `yaml:"enforcement"`
VideoGuidance `yaml:",inline"`
}
func DefaultVideoPolicy ¶
func DefaultVideoPolicy() VideoMetadataPolicy
func (VideoMetadataPolicy) CheckMessage ¶
func (p VideoMetadataPolicy) CheckMessage(msg *sapientv2.SapientMessage, metrics *Metrics) []Violation
Click to show internal directories.
Click to hide internal directories.