Documentation ¶
Index ¶
- Variables
- func DefaultLimitedReader(r io.Reader) io.Reader
- func NewLimitedReader(r io.Reader, n int64) io.Reader
- type Account
- func (a *Account) AccountURL(ctx context.Context, uris_table *uris.URIs) *url.URL
- func (a *Account) Address(hostname string) string
- func (a *Account) InboxURL(ctx context.Context, uris_table *uris.URIs) *url.URL
- func (a *Account) OutboxURL(ctx context.Context, uris_table *uris.URIs) *url.URL
- func (a *Account) PostURL(ctx context.Context, uris_table *uris.URIs, post *Post) *url.URL
- func (a *Account) PrivateKey(ctx context.Context) (string, error)
- func (a *Account) PrivateKeyRSA(ctx context.Context) (*rsa.PrivateKey, error)
- func (a *Account) ProfileResource(ctx context.Context, uris_table *uris.URIs) (*ap.Actor, error)
- func (a *Account) ProfileURL(ctx context.Context, uris_table *uris.URIs) *url.URL
- func (a *Account) PublicKey(ctx context.Context) (string, error)
- func (a *Account) PublicKeyRSA(ctx context.Context) (*rsa.PublicKey, error)
- func (a *Account) SendActivity(ctx context.Context, uris_table *uris.URIs, inbox_uri string, ...) error
- func (a *Account) String() string
- func (a *Account) WebfingerResource(ctx context.Context, uris_table *uris.URIs) (*webfinger.Resource, error)
- func (a *Account) WebfingerURL(ctx context.Context, uris_table *uris.URIs) *url.URL
- type AccountType
- type Activity
- type ActivityType
- type Alias
- type Block
- type Boost
- type Boosted
- type Delivery
- type Follower
- type Following
- type Like
- type Message
- type Note
- type Post
- type PostTag
- type Property
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("Not found")
ErrNotFound is an error indicating that an item is not present or was not found.
var ErrNotImplemented = errors.New("Not implemented")
ErrNotImplemented is an error indicating that a feature or specific functionality is not implemented.
Functions ¶
Types ¶
type Account ¶
type Account struct { // Id is a unique numeric identifier for the account Id int64 `json:"id"` // AccountType denotes the ActivityPub account type AccountType AccountType `json:"account_type"` // Name is the unique account name for the account Name string `json:"name"` // DisplayName is the long-form name for the account (which is not guaranteed to be unique across all accounts) DisplayName string `json:"display_name"` // Blurb is the descriptive text for the account Blurb string `json:"blurb"` // URL is the primary website associated with the account URL string `json:"url"` // PublicKeyURI is a valid `gocloud.dev/runtimevar` referencing the PEM-encoded public key for the account. PublicKeyURI string `json:"public_key_uri"` // PublicKeyURI is a valid `gocloud.dev/runtimevar` referencing the PEM-encoded private key for the account. PrivateKeyURI string `json:"private_key_uri"` // ManuallyApproveFollowers is a boolean flag signaling that follower requests need to be manually approved. Note: There are currently no tools or interfaces for handling those approvals. ManuallyApproveFollowers bool `json:"manually_approve_followers"` // Discoverable is a boolean flag signaling that the account is discoverable. Discoverable bool `json:"discoverable"` // IconURI is a valid `gocloud.dev/blob` URI (as in the bucket URI + filename) referencing the icon URI for the account. IconURI string `json:"icon_uri"` // Created is a Unix timestamp of when the account was created. Created int64 `json:"created"` // LastModified is a Unix timestamp of when the account was last modified. LastModified int64 `json:"lastmodified"` }
Account represents an individual ActivityPub account
func (*Account) AccountURL ¶
func (*Account) PrivateKeyRSA ¶
func (*Account) ProfileResource ¶
func (*Account) ProfileURL ¶
func (*Account) PublicKeyRSA ¶
func (*Account) SendActivity ¶ added in v0.0.2
func (*Account) WebfingerResource ¶
type AccountType ¶
type AccountType uint32
AccountType denotes the ActivityPub account type
const ( // PersonType is considered to be an actual human being PersonType AccountType // ServiceType is considered to be a "bot" or other automated account ServiceType )
func AccountTypeFromString ¶
func AccountTypeFromString(str_type string) (AccountType, error)
AccountTypeFromString returns a known AccountType derived from 'str_type' (an English-language label)
func (AccountType) String ¶
func (t AccountType) String() string
String returns an English-language label for the AccountType
type Activity ¶ added in v0.0.2
type Activity struct { // A unique 64-bit ID for the activity Id int64 `json:"id"` // The unique ID associated with the ActivityPub Activity (Body) ActivityPubId string `json:"activity_id"` // The unique 64-bit ID for account associated with the activity AccountId int64 `json:"id"` // A valid object type (as in an ActivityPub object) supported by this package ActivityType ActivityType `json:"activity_type"` // The unique 64-bit ID associated with the activity type (for example if ActivityType is PostActivityType then ActivityId would be unique ID for that post). ActivityTypeId int64 `json:"activity_type_id"` // The JSON-encoded body of the ActivityPub Activity Body string `json:"body"` // The Unix timestamp when the activity was created. Created int64 `json:"created"` }
Type Activity is internal representation of an ActivityPub Activity message with pointers to other relevant internal representations of things like account IDs rather than actor URIs, etc.
func NewActivity ¶ added in v0.0.2
NewActivity returns a new `Activity` instance using properties derived from 'ap_activity'.
type ActivityType ¶ added in v0.0.2
type ActivityType int
const ( // UndefinedActivityType is an unknown (or undefined) object type UndefinedActivityType ActivityType = iota PostActivityType BoostActivityType )
type Alias ¶
type Block ¶
type Boost ¶
type Boost struct { Id int64 `json:"id"` AccountId int64 `json:"account_id"` PostId int64 `json:"post_id"` Actor string `json:"actor"` Created int64 `json:"created"` }
Type Boost is possibly (probably) a misnomer in the same way that type `Post` is (see notes in post.go). Specifically this data and the correspinding `BoostsDatabase` was created to record boosts from external actors about posts created by accounts on this server. It is not currently suited to record or deliver boosts of external posts made by accounts on this server.
type Boosted ¶ added in v0.0.2
type Boosted struct { Id int64 `json:"id"` AccountId int64 `json:"account_id"` Author string `json:"author"` Object string `json:"object"` Created int64 `json:"created"` }
Type Boosted represents an object/URI/thing that a sfomuseum/go-activitypub.Account has boosted. It remains TBD whether this should try to be merged with the `Boost` struct below which would really mean replace `Boost.PostId` with `Boost.Object`...
type Delivery ¶
type Delivery struct { Id int64 `json:"id"` ActivityId int64 `json:"activity_id"` ActivityPubId string `json:"activitypub_id"` AccountId int64 `json:"account_id"` Recipient string `json:"recipient"` Inbox string `json:"inbox"` Created int64 `json:"created"` Completed int64 `json:"completed"` Success bool `json:"success"` Error string `json:"error,omitempty"` }
type Follower ¶
type Following ¶
type Like ¶
type Like struct { Id int64 `json:"id"` AccountId int64 `json:"account_id"` PostId int64 `json:"post_id"` Actor string `json:"actor"` Created int64 `json:"created"` }
Type Like is possibly (probably) a misnomer in the same way that type `Post` is (see notes in post.go and boost.go). Specifically this data and the correspinding `LikesDatabase` was created to record likes from external actors about posts created by accounts on this server. It is not currently suited to record or deliver likes of external posts made by accounts on this server.
type Message ¶
type Note ¶
type Note struct { Id int64 `json:"id"` UUID string `json:"uuid"` AuthorAddress string `json:"author_address"` Body string `json:"body"` Created int64 `json:"created"` LastModified int64 `json:"lastmodified"` }
Note is a message (or post) delivered to an account.
type Post ¶
type Post struct { // The unique ID for the post. Id int64 `json:"id"` // The AccountsDatabase ID of the author of the post. AccountId int64 `json:"account_id"` // The body of the post. This is a string mostly because []byte thingies get encoded incorrectly // in DynamoDB Body string `json:"body"` // The URL of the post this post is referencing. InReplyTo string `json:"in_reply_to"` // The Unix timestamp when the post was created Created int64 `json:"created"` // The Unix timestamp when the post was last modified LastModified int64 `json:"lastmodified"` }
Post is a message (or post) written by an account holder. It is internal representation of what would be delivered as an ActivityPub note.x
type PostTag ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
app
|
|
aliases/add
Add one or more aliases for a sfomuseum/go-activitypub account.
|
Add one or more aliases for a sfomuseum/go-activitypub account. |
aliases/list
Gather the list of aliases for a given account and emit as JSON-encoded string to STDOUT.
|
Gather the list of aliases for a given account and emit as JSON-encoded string to STDOUT. |
cmd
|
|
Package crypto provides methods for generating and processing x509 public and private keys.
|
Package crypto provides methods for generating and processing x509 public and private keys. |
Package database defines interfaces and default implementation for the underlying databases (or database tables) used to store ActivityPub related operations.
|
Package database defines interfaces and default implementation for the underlying databases (or database tables) used to store ActivityPub related operations. |
Package deliver provides methods for delivering activities to external actors.
|
Package deliver provides methods for delivering activities to external actors. |
Package id provides methods for generating unique identifiers.
|
Package id provides methods for generating unique identifiers. |
schema
|
|
Package template provides methods and default templates used by this package.
|
Package template provides methods and default templates used by this package. |
html
Package html defines methods and default templates for generating HTML pages.
|
Package html defines methods and default templates for generating HTML pages. |