Lots of work
This commit is contained in:
parent
a2a937791d
commit
3086b0e9b4
28 changed files with 1284 additions and 2 deletions
33
storage/serverTypes.go
Normal file
33
storage/serverTypes.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Mostly important for rendering
|
||||
type RemoteServerType string
|
||||
|
||||
const (
|
||||
// Includes forks like glitch-soc, etc
|
||||
REMOTE_SERVER_MASTODON = RemoteServerType("Mastodon")
|
||||
// Includes forks like Ice Shrimp, Sharkey, Cutiekey, etc
|
||||
REMOTE_SERVER_MISSKEY = RemoteServerType("Misskey")
|
||||
// Includes Akkoma
|
||||
REMOTE_SERVER_PLEMORA = RemoteServerType("Plemora")
|
||||
// And of course, yours truly
|
||||
REMOTE_SERVER_LINSTROM = RemoteServerType("Linstrom")
|
||||
)
|
||||
|
||||
func (r *RemoteServerType) Value() (driver.Value, error) {
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *RemoteServerType) Scan(raw any) error {
|
||||
if v, ok := raw.(string); ok {
|
||||
*r = RemoteServerType(v)
|
||||
return nil
|
||||
} else {
|
||||
return errors.New("value not a string")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue