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

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