entity_post.go 2.14 KB
Newer Older
zauberstuhl's avatar
zauberstuhl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package federation
//
// GangGo Diaspora Federation Library
// Copyright (C) 2017 Lukas Matt <lukas@zauberstuhl.de>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

zauberstuhl's avatar
zauberstuhl committed
20
import "github.com/Zauberstuhl/go-xml"
zauberstuhl's avatar
zauberstuhl committed
21 22

type EntityStatusMessage struct {
23 24
  XMLName xml.Name `xml:"status_message"`
  Author string `xml:"author"`
zauberstuhl's avatar
zauberstuhl committed
25
  Guid string `xml:"guid"`
26
  CreatedAt Time `xml:"created_at"`
zauberstuhl's avatar
zauberstuhl committed
27
  ProviderName string `xml:"provider_display_name"`
28
  Text string `xml:"text,omitempty"`
29
  Photos *EntityPhotos `xml:"photo,omitempty"`
zauberstuhl's avatar
zauberstuhl committed
30 31 32
  Location *EntityLocation `xml:"location,omitempty"`
  Poll *EntityPoll `xml:"poll,omitempty"`
  Public bool `xml:"public"`
33 34 35 36 37 38 39 40 41 42
  Event *EntityEvent `xml:"event,omitempty"`
}

type EntityReshare struct {
  XMLName xml.Name `xml:"reshare"`
  Author string `xml:"author"`
  Guid string `xml:"guid"`
  CreatedAt Time `xml:"created_at"`
  RootAuthor string `xml:"root_author"`
  RootGuid string `xml:"root_guid"`
zauberstuhl's avatar
zauberstuhl committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
}

type EntityLocation struct {
  Address string `xml:"address"`
  Lat string `xml:"lat"`
  Lng string `xml:"lng"`
}

type EntityPoll struct {
  Guid string `xml:"guid"`
  Question string `xml:"question"`
  PollAnswers []EntityPollAnswer `xml:"poll_answers"`
}

type EntityPollAnswer struct {
  Guid string `xml:"guid"`
  Answer string `xml:"answer"`
}

62 63 64 65 66 67 68 69 70 71
type EntityEvent struct {
  Author string `xml:"author"`
  Guid string `xml:"guid"`
  Summary string `xml:"summary"`
  Start Time `xml:"start"`
  End Time `xml:"end"`
  AllDay bool `xml:"all_day"`
  Timezone string `xml:"timezone"`
  Description string `xml:"description"`
  Location *EntityLocation `xml:"location,omitempty"`
zauberstuhl's avatar
zauberstuhl committed
72
}