activitystream

package
v0.0.0-...-e5a0b23 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateType                = "Create"
	NoteType                  = "Note"
	OrderedCollectionPageType = "OrderedCollectionPage"
)
View Source
const ActivityStreamsContentType = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept struct {
	Activity
	Item Activity `json:"object"`
}

type Activity

type Activity struct {
	Actor string `json:"actor,omitempty"` // TODO: 実はmaybe object
	Item  Object `json:"object,omitempty"`
}

type Collection

type Collection struct {
	TotalItems *int   `json:"totalItems,omitempty"`
	First      string `json:"first,omitempty"` // TODO: maybe Link
	Last       string `json:"last,omitempty"`
}

type Icon

type Icon struct {
	Type      string `json:"type,omitempty"`
	MediaType string `json:"mediaType,omitempty"`
	URL       string `json:"url,omitempty"`
}

type Object

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

func NewAccept

func NewAccept(act Activity, actorID string, acceptID string) *Object

func NewCreate

func NewCreate(createID string, actor string, to []string, cc []string, obj Object) *Object

func NewMention

func NewMention(toID string) Object

func NewNote

func NewNote(noteID string, published string, name string, content string, attributedTo string, to []string, cc []string, tag []Object) *Object

func NewOrderedCollection

func NewOrderedCollection(id string, totalItems int, first string, last string) *Object

func NewOrderedCollectionPage

func NewOrderedCollectionPage(id string, partOf string, next string, prev string, orderdItems interface{}) *Object

func NewTag

func NewTag(tagType string, name string, href string) Object

func NewUserResource

func NewUserResource(ID string, name string, IconURI string, iconMediaType string, PreferredUsername string, inbox string, outbox string, followers string, following string, comment string, keyID string, publicKey string) *Object

func (*Object) Activity

func (o *Object) Activity() (Activity, bool)

func (*Object) MarshalJSON

func (o *Object) MarshalJSON() ([]byte, error)

func (*Object) OrderedCollectionPage

func (o *Object) OrderedCollectionPage() (OrderedCollectionPage, bool)

func (*Object) UnmarshalJSON

func (o *Object) UnmarshalJSON(data []byte) error

type OrderedCollectionPage

type OrderedCollectionPage struct {
	Collection
	PartOf       string      `json:"partOf"`
	Next         string      `json:"next"`
	Prev         string      `json:"prev"`
	OrderedItems interface{} `json:"orderedItems"`
}

type PublicKey

type PublicKey struct {
	ID           string `json:"id"`
	Owner        string `json:"owner"`
	PublicKeyPem string `json:"publicKeyPem"`
}

type ReceivedInbox

type ReceivedInbox struct {
	Activity

	Item json.RawMessage `json:"object"`
}

type UserResource

type UserResource struct {
	PreferredUsername string `json:"preferredUsername"`

	Inbox     string `json:"inbox"`
	Outbox    string `json:"outbox"`
	Summary   string `json:"summary"`
	Followers string `json:"followers"`
	Following string `json:"following"`
	Liked     string `json:"liked,omitempty"`

	PublicKey PublicKey `json:"publicKey"`
}

func FetchActorInfo

func FetchActorInfo(actor string) (*UserResource, error)

Jump to

Keyboard shortcuts

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