Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13809606
activity.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
activity.go
View Options
package
activitystreams
import
(
"time"
)
const
(
toPublic
=
"https://www.w3.org/ns/activitystreams#Public"
)
type
Activity
struct
{
BaseObject
Actor
string
`json:"actor"`
Published
time
.
Time
`json:"published,omitempty"`
To
[]
string
`json:"to,omitempty"`
CC
[]
string
`json:"cc,omitempty"`
Object
*
Object
`json:"object"`
}
func
NewCreateActivity
(
o
*
Object
)
*
Activity
{
a
:=
Activity
{
BaseObject
:
BaseObject
{
Context
:
[]
interface
{}{
"https://www.w3.org/ns/activitystreams"
,
},
ID
:
o
.
ID
+
"/activity"
,
Type
:
"Create"
,
},
Actor
:
o
.
AttributedTo
,
Object
:
o
,
}
return
&
a
}
type
Object
struct
{
BaseObject
Published
time
.
Time
`json:"published"`
Summary
*
string
`json:"summary,omitempty"`
InReplyTo
*
string
`json:"inReplyTo"`
URL
string
`json:"url"`
AttributedTo
string
`json:"attributedTo"`
To
[]
string
`json:"to"`
CC
[]
string
`json:"cc,omitempty"`
Name
string
`json:"name,omitempty"`
Content
string
`json:"content"`
ContentMap
map
[
string
]
string
`json:"contentMap,omitempty"`
}
func
NewNoteObject
()
*
Object
{
o
:=
Object
{
BaseObject
:
BaseObject
{
Type
:
"Note"
,
},
To
:
[]
string
{
toPublic
,
},
}
return
&
o
}
func
NewArticleObject
()
*
Object
{
o
:=
Object
{
BaseObject
:
BaseObject
{
Type
:
"Article"
,
},
To
:
[]
string
{
toPublic
,
},
}
return
&
o
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 11, 3:28 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3624882
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment