entity_post.go 2.55 KB
Newer Older
Lukas Matt's avatar
Lukas Matt 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/>.
//

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

type EntityStatusMessage struct {
23 24
  XMLName xml.Name `xml:"status_message"`
  Author string `xml:"author"`
Lukas Matt's avatar
Lukas Matt committed
25
  Guid string `xml:"guid"`
26
  CreatedAt Time `xml:"created_at"`
Lukas Matt's avatar
Lukas Matt committed
27
  ProviderName string `xml:"provider_display_name"`
28
  Text string `xml:"text,omitempty"`
Lukas Matt's avatar
Lukas Matt committed
29 30 31 32
  Photo *EntityPhotos `xml:"photo,omitempty"`
  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"`
Lukas Matt's avatar
Lukas Matt committed
43 44 45 46 47 48
}

type EntityPhoto struct {
  Guid string `xml:"guid"`
  Author string `xml:"author"`
  Public bool `xml:"public"`
49
  CreatedAt Time `xml:"created_at"`
Lukas Matt's avatar
Lukas Matt committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
  RemotePhotoPath string `xml:"remote_photo_path"`
  RemotePhotoName string `xml:"remote_photo_name"`
  Text string `xml:"text"`
  StatusMessageGuid string `xml:"status_message_guid"`
  Height int `xml:"height"`
  Width int `xml:"width"`
}

type EntityPhotos []EntityPhoto

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"`
}

77 78 79 80 81 82 83 84 85 86
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"`
Lukas Matt's avatar
Lukas Matt committed
87
}