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

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