You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
1.8 KiB
Go

package mobilizon
import (
"time"
)
// These are needed so our graphql can unmarshal things :(
type String string
type Int int
type Bool bool
type ID string
type UUID string
type Auth struct {
AccessToken String
RefreshToken String
}
type Login struct {
Auth
User User
}
type User struct {
ID ID
Email ID
DefaultActor Person
Role String // enum
}
type Actor struct {
ID ID
Type String // enum
Name String
Local Bool
Domain String
}
type Person struct {
Actor
FeedTokens []struct{ Token String }
MemberOf []Member
}
type Member struct {
ID ID
Role String // MemberRoleEnum
}
type Event struct {
UUID UUID
ID ID
Title String
Description String
PhysicalAddress Address
BeginsOn time.Time
EndsOn time.Time
Picture Media
}
type Media struct {
ID ID
Name String
Alt String
URL String
ContentType String
Size Int
Metadata struct {
Blurhash String
Height Int
Width Int
}
}
type Address struct {
// ID ID // FIXME: this breaks AddressInput
// Geom Point
Description String
OriginId String
Street String
PostalCode String
Locality String
Region String
Country String
Timezone String
Type String
URL String
}
type Point string
// type Point struct {
// Lon float64
// Lat float64
// }
// func (p *Point) UnmarshalJSON(b []byte) (err error) {
// coords := strings.Split(string(b[1:len(b)-1]), ";")
// p.Lon, err = strconv.ParseFloat(coords[0], 64)
// p.Lat, err = strconv.ParseFloat(coords[1], 64)
// return
// }
// func (l *Point) MarshalJSON() (b []byte, err error) {
// return []byte(fmt.Sprintf("\"%v;%v\"", l.Lon, l.Lat)), nil
// }