Documentation ¶
Index ¶
- Constants
- type Badge
- type Comment
- type Post
- type PostHistory
- type PostLink
- type Reader
- func NewBadgesReader(r io.Reader) (*Reader, error)
- func NewBadgesReaderFromFile(path string) (*Reader, error)
- func NewCommentsReader(r io.Reader) (*Reader, error)
- func NewCommentsReaderFromFile(path string) (*Reader, error)
- func NewPostHistoryReader(r io.Reader) (*Reader, error)
- func NewPostHistoryReaderFromFile(path string) (*Reader, error)
- func NewPostLinksReader(r io.Reader) (*Reader, error)
- func NewPostLinksReaderFromFile(path string) (*Reader, error)
- func NewPostsReader(r io.Reader) (*Reader, error)
- func NewPostsReaderFromFile(path string) (*Reader, error)
- func NewTagsReader(r io.Reader) (*Reader, error)
- func NewTagsReaderFromFile(path string) (*Reader, error)
- func NewUsersReader(r io.Reader) (*Reader, error)
- func NewUsersReaderFromFile(path string) (*Reader, error)
- func NewVotesReader(r io.Reader) (*Reader, error)
- func NewVotesReaderFromFile(path string) (*Reader, error)
- type Tag
- type User
- type Vote
Constants ¶
const ( HistoryInitialTitle = 1 HistoryInitialBody = 2 HistoryInitialTags = 3 HistoryEditTitle = 4 HistoryEditBody = 5 HistoyrEditTags = 6 HistoryRollbackTitle = 7 HistoryRollbackBody = 8 HistoryRollbackTags = 9 HistoryPostClosed = 10 HistoryPostReopened = 11 HistoryPostDeleted = 12 HistoryPostUndeleted = 13 HistoryPostLocked = 14 HistoryPostUnlocked = 15 HistoryCommunityOwned = 16 HistoryPostMigrated = 17 HistoryQuestionMerged = 18 HistoryQuestionProtected = 19 HistoryQuestionUnprotected = 20 HistoryPostDisassociated = 21 HistoryQuestionUnmerged = 22 HistorySuggestedEditApplied = 24 HistoryPostTweeted = 25 HistoryCommentDiscussionMovedToChat = 26 HistoryPostNoticeAdded = 33 HistoryPostNoticeRemoved = 34 HistoryPostMigratedAway = 35 // replaces id 17 HistoryPostMigratedHere = 36 // replaces id 17 HistoryPostMergeSource = 37 HistoryPostMergeDestination = 38 )
const ( LinkTypeLinked = 1 LinkTypeDuplicate = 2 )
const ( PostQuestion = 1 PostAnswer = 2 PostOrphanedTagWiki = 3 PostTagWikiExcerpt = 4 PostTagWiki = 5 PostModeratorNomination = 6 PostWikiPlaceholder = 7 PostPrivilegeWiki = 8 )
const ( VoteAcceptedByOriginator = 1 VoteUpMod = 2 VoteDownMod = 3 VoteOffensive = 4 VoteFavorite = 5 VoteClose = 6 VoteReopen = 7 VoteBountyStart = 8 VoteBountyClose = 9 VoteDeletion = 10 VoteUndeletion = 11 VoteSpam = 12 VoteModeratorReview = 15 VoteApproveEditoSuggestion = 16 )
http://blog.stackoverflow.com/2009/06/stack-overflow-creative-commons-data-dump/#comment-24147 http://meta.stackexchange.com/questions/2677/database-schema-documentation-for-the-public-data-dump-and-sede?rq=1 http://data.stackexchange.com/stackoverflow/query/102390/vote-types
const (
// TimeFormat is how time is formatted in .xml files
TimeFormat = "2006-01-02T15:04:05.999999999"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID int PostID int Score int Text string CreationDate time.Time UserID int UserDisplayName string }
Comment describes a comment
type Post ¶
type Post struct { ID int PostTypeID int ParentID int // for PostAnswer AcceptedAnswerID int CreationDate time.Time Score int ViewCount int Body string OwnerUserID int OwnerDisplayName string LastEditorUserID int LastEditorDisplayName string LastEditDate time.Time LastActivitityDate time.Time Title string Tags []string AnswerCount int CommentCount int FavoriteCount int CommunityOwnedDate time.Time ClosedDate time.Time }
Post describes a post
type PostHistory ¶
type PostHistory struct { ID int PostHistoryTypeID int PostID int RevisionGUID string CreationDate time.Time UserID int UserDisplayName string // if PostHistoryTypeID is 10, 11, 12, 13, 14, 15, this is JSON // with users who voted Text string // if PostHistoryTypeID is HistoryInitialTags or HistoyrEditTags // or HistoryRollbackTags, this is a decoded version of tags Tags []string Comment string }
PostHistory describes history of a post
type Reader ¶
type Reader struct { User User Post Post Comment Comment Badge Badge Tag Tag PostHistory PostHistory PostLink PostLink Vote Vote // contains filtered or unexported fields }
Reader is for iteratively reading records from xml file
func NewBadgesReader ¶
NewBadgesReader returns a new reader for Badges.xml file
func NewBadgesReaderFromFile ¶
NewBadgesReaderFromFile returns a new reader for Badges.xml file
func NewCommentsReader ¶
NewCommentsReader returns a new reader for Comments.xml file
func NewCommentsReaderFromFile ¶
NewCommentsReaderFromFile returns a new reader for Comments.xml file
func NewPostHistoryReader ¶
NewPostHistoryReader returns a new reader for PostHistory.xml file
func NewPostHistoryReaderFromFile ¶
NewPostHistoryReaderFromFile returns a new reader for PostHistory.xml file
func NewPostLinksReader ¶
NewPostLinksReader returns a new reader for PostLinks.xml file
func NewPostLinksReaderFromFile ¶
NewPostLinksReaderFromFile returns a new reader for PostLinks.xml file
func NewPostsReader ¶
NewPostsReader returns a new reader for Posts.xml file
func NewPostsReaderFromFile ¶
NewPostsReaderFromFile returns a new reader for Posts.xml file
func NewTagsReader ¶
NewTagsReader returns a new reader for Comments.xml file
func NewTagsReaderFromFile ¶
NewTagsReaderFromFile returns a new reader for Comments.xml file
func NewUsersReader ¶
NewUsersReader returns a new reader for Users.xml file
func NewUsersReaderFromFile ¶
NewUsersReaderFromFile returns a new reader for Users.xml file
func NewVotesReader ¶
NewVotesReader returns a new reader for Votes.xml file
func NewVotesReaderFromFile ¶
NewVotesReaderFromFile returns a new reader for Votes.xml file