github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/app/lib/types/xml.go (about)

     1  // Package types - Content managed by Project Forge, see [projectforge.md] for details.
     2  package types
     3  
     4  const KeyXML = "xml"
     5  
     6  type XML struct{}
     7  
     8  var _ Type = (*XML)(nil)
     9  
    10  func (x *XML) Key() string {
    11  	return KeyXML
    12  }
    13  
    14  func (x *XML) Sortable() bool {
    15  	return true
    16  }
    17  
    18  func (x *XML) Scalar() bool {
    19  	return false
    20  }
    21  
    22  func (x *XML) String() string {
    23  	return x.Key()
    24  }
    25  
    26  func (x *XML) From(v any) any {
    27  	return invalidInput(x.Key(), v)
    28  }
    29  
    30  func (x *XML) Default(string) any {
    31  	return "<element />"
    32  }
    33  
    34  func NewXML() *Wrapped {
    35  	return Wrap(&XML{})
    36  }