Add comments to storage types

This commit is contained in:
mStar aka a person 2024-06-06 11:54:50 +00:00
parent 1fbdf7fc9d
commit 94197780e1
7 changed files with 31 additions and 8 deletions

View file

@ -5,19 +5,28 @@ import (
"errors"
)
// What feed a note is targeting (public, home, followers or dm)
type NoteTarget uint8
const (
// The note is intended for the public
NOTE_TARGET_PUBLIC = NoteTarget(0)
// The note is intended only for the home screen
// not really any idea what the difference is compared to public
// Maybe home notes don't show up on the server feed but still for everyone's home feed if it reaches them via follow or boost
NOTE_TARGET_HOME = NoteTarget(1 << iota)
// The note is intended only for followers
NOTE_TARGET_FOLLOWERS
// The note is intended only for a DM to one or more targets
NOTE_TARGET_DM
)
// Converts the NoteTarget value into a type the DB can use
func (n *NoteTarget) Value() (driver.Value, error) {
return n, nil
}
// Converts the raw value from the DB into a NoteTarget
func (n *NoteTarget) Scan(value any) error {
vBig, ok := value.(int64)
if !ok {