Documentation
¶
Index ¶
- Variables
- func EventPointXSD() []byte
- func ListAvailableSchemas() []string
- func ResetForTest()
- func SetEventPointXSDForTest(data []byte)
- func SetMkTempForTest(f func(string, string) (string, error))
- func SetWriteSchemasForTest(f func(string) error)
- func ValidateAgainstSchema(name string, xml []byte) error
- func ValidateChat(data []byte) error
- type ChatSchema
- type Schema
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidChat = errors.New("invalid chat")
ErrInvalidChat indicates the chat extension does not conform to the schema.
Functions ¶
func EventPointXSD ¶ added in v0.3.1
func EventPointXSD() []byte
EventPointXSD returns the raw XSD bytes for the event point schema.
func ListAvailableSchemas ¶
func ListAvailableSchemas() []string
ListAvailableSchemas returns a list of all available schema names.
func ResetForTest ¶ added in v0.3.1
func ResetForTest()
ResetForTest resets package state for testing.
func SetEventPointXSDForTest ¶ added in v0.3.3
func SetEventPointXSDForTest(data []byte)
SetEventPointXSDForTest sets the event point schema bytes for testing.
func SetMkTempForTest ¶ added in v0.3.1
SetMkTempForTest sets the MkdirTemp function for testing.
func SetWriteSchemasForTest ¶ added in v0.3.1
SetWriteSchemasForTest sets the schema writing function for testing.
func ValidateAgainstSchema ¶
ValidateAgainstSchema validates XML against a named schema.
func ValidateChat ¶
ValidateChat parses and validates a __chat extension.
Types ¶
type ChatSchema ¶
type ChatSchema struct { XMLName xml.Name `xml:"__chat"` ID string `xml:"id,attr,omitempty"` Message string `xml:"message,attr"` Sender string `xml:"sender,attr"` }
ChatSchema defines the expected attributes for the __chat extension.
Click to show internal directories.
Click to hide internal directories.