activitystreams

package
v0.0.0-...-75625ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2017 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Object ObjectLike `xml:"http://activitystrea.ms/spec/1.0/ object" json:"object,omitempty"`
	// contains filtered or unexported fields
}

func (*Activity) GetActor

func (a *Activity) GetActor() *Author

func (*Activity) GetInReplyTo

func (a *Activity) GetInReplyTo() *InReplyTo

func (*Activity) GetObject

func (a *Activity) GetObject() ObjectLike

func (*Activity) GetObjectType

func (a *Activity) GetObjectType() string

func (*Activity) GetSummary

func (a *Activity) GetSummary() string

func (*Activity) GetTime

func (a *Activity) GetTime() time.Time

func (*Activity) GetTitle

func (a *Activity) GetTitle() string

func (*Activity) GetVerb

func (a *Activity) GetVerb() string

func (*Activity) UnmarshalXML

func (a *Activity) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ActivityLike

type ActivityLike interface {
	ObjectLike

	GetActor() *Author
	GetObject() ObjectLike
	GetVerb() string
	GetTime() time.Time
	GetTitle() string
}

type Author

type Author struct {
	commonxml.HasLinks

	XMLName           xml.Name       `json:"-"`
	ID                string         `xml:"http://www.w3.org/2005/Atom id,omitempty" json:"id,omitempty"`
	Name              string         `xml:"http://www.w3.org/2005/Atom name" json:"name,omitempty"`
	URI               string         `xml:"http://www.w3.org/2005/Atom uri,omitempty" json:"uri,omitempty"`
	Email             string         `xml:"http://www.w3.org/2005/Atom email,omitempty" json:"email,omitempty"`
	Summary           string         `xml:"http://www.w3.org/2005/Atom summary,omitempty" json:"summary,omitempty"`
	ObjectType        string         `xml:"http://activitystrea.ms/spec/1.0/ object-type" json:"objectType,omitempty"`
	PreferredUsername string         `xml:"http://portablecontacts.net/spec/1.0 preferredUsername" json:"preferredUsername,omitempty"`
	DisplayName       string         `xml:"http://portablecontacts.net/spec/1.0 displayName" json:"displayName,omitempty"`
	Note              string         `xml:"http://portablecontacts.net/spec/1.0 note" json:"note,omitempty"`
	URLs              []AuthorURL    `xml:"http://portablecontacts.net/spec/1.0 urls" json:"urls,omitempty"`
	Address           *AuthorAddress `xml:"http://portablecontacts.net/spec/1.0 address" json:"address,omitempty"`
	Scope             string         `xml:"http://mastodon.social/schema/1.0 scope" json:"scope,omitempty"`
}

func (*Author) GetBestAvatar

func (a *Author) GetBestAvatar() string

func (*Author) GetID

func (a *Author) GetID() string

func (*Author) GetName

func (a *Author) GetName() string

func (*Author) GetObjectType

func (a *Author) GetObjectType() string
func (a *Author) GetPermalink() string

func (*Author) GetRepresentativeImage

func (a *Author) GetRepresentativeImage() string

func (*Author) GetSummary

func (a *Author) GetSummary() string

type AuthorAddress

type AuthorAddress struct {
	Formatted string `xml:"http://portablecontacts.net/spec/1.0 formatted" json:"type"`
}

type AuthorURL

type AuthorURL struct {
	Type    string `xml:"http://portablecontacts.net/spec/1.0 type" json:"type"`
	Value   string `xml:"http://portablecontacts.net/spec/1.0 value" json:"value"`
	Primary bool   `xml:"http://portablecontacts.net/spec/1.0 primary" json:"primary"`
}

type Comment

type Comment struct {
	GenericObject

	Content []Content `xml:"http://www.w3.org/2005/Atom content,omitempty" json:"content,omitempty"`
}

func (*Comment) GetContent

func (c *Comment) GetContent() string

type Content

type Content struct {
	Type string `xml:"type,attr" json:"type,omitempty"`
	Body string `xml:",chardata" json:"body,omitempty"`
}

type Entry

type Entry struct {
	Object ObjectLike `json:"object"`
	// contains filtered or unexported fields
}

func (*Entry) GetActor

func (a *Entry) GetActor() *Author

func (*Entry) GetContent

func (e *Entry) GetContent() string

func (*Entry) GetID

func (a *Entry) GetID() string

func (*Entry) GetInReplyTo

func (e *Entry) GetInReplyTo() *InReplyTo

func (*Entry) GetName

func (a *Entry) GetName() string

func (*Entry) GetObject

func (a *Entry) GetObject() ObjectLike

func (*Entry) GetObjectType

func (a *Entry) GetObjectType() string
func (a *Entry) GetPermalink() string

func (*Entry) GetRepresentativeImage

func (a *Entry) GetRepresentativeImage() string

func (*Entry) GetSummary

func (a *Entry) GetSummary() string

func (*Entry) GetTime

func (a *Entry) GetTime() time.Time

func (*Entry) GetTitle

func (a *Entry) GetTitle() string

func (*Entry) GetVerb

func (a *Entry) GetVerb() string

func (*Entry) UnmarshalXML

func (a *Entry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Feed

type Feed struct {
	// contains filtered or unexported fields
}

func Fetch

func Fetch(u string) (*Feed, error)

func Parse

func Parse(d []byte) (*Feed, error)

func (*Feed) GetActivities

func (f *Feed) GetActivities() []ActivityLike

func (*Feed) GetHub

func (f *Feed) GetHub() string

func (*Feed) GetSalmon

func (f *Feed) GetSalmon() string

func (*Feed) UnmarshalXML

func (f *Feed) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GenericObject

type GenericObject struct {
	commonxml.HasLinks

	ID         string `xml:"http://www.w3.org/2005/Atom id,omitempty" json:"id,omitempty"`
	Title      string `xml:"http://www.w3.org/2005/Atom title,omitempty" json:"title,omitempty"`
	Summary    string `xml:"http://www.w3.org/2005/Atom summary,omitempty" json:"summary,omitempty"`
	ObjectType string `xml:"http://activitystrea.ms/spec/1.0/ object-type" json:"objectType,omitempty"`
}

func (*GenericObject) GetID

func (o *GenericObject) GetID() string

func (*GenericObject) GetName

func (o *GenericObject) GetName() string

func (*GenericObject) GetObjectType

func (o *GenericObject) GetObjectType() string
func (o *GenericObject) GetPermalink() string

func (*GenericObject) GetRepresentativeImage

func (o *GenericObject) GetRepresentativeImage() string

func (*GenericObject) GetSummary

func (o *GenericObject) GetSummary() string

type HasContent

type HasContent interface {
	GetContent() string
}

type HasInReplyTo

type HasInReplyTo interface {
	GetInReplyTo() *InReplyTo
}

type InReplyTo

type InReplyTo struct {
	XMLName xml.Name `xml:"http://purl.org/syndication/thread/1.0 in-reply-to" json:"-"`
	Ref     string   `xml:"ref,attr" json:"ref"`
	Href    string   `xml:"href,attr" json:"href"`
}

type Note

type Note struct {
	GenericObject

	Content []Content `xml:"http://www.w3.org/2005/Atom content,omitempty" json:"content,omitempty"`
}

func (*Note) GetContent

func (n *Note) GetContent() string

type NoteLike

type NoteLike interface {
	ObjectLike

	GetContent() string
}

type ObjectLike

type ObjectLike interface {
	GetID() string
	GetName() string
	GetSummary() string
	GetRepresentativeImage() string
	GetPermalink() string
	GetObjectType() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL