Documentation
¶
Index ¶
- Constants
- Variables
- func Announce(ap *client.C, actor vocab.Actor, l lw.Logger, iris ...string) error
- func Appreciation(ap *client.C, actor vocab.Actor, l lw.Logger, typ vocab.ActivityVocabularyType, ...) error
- func Author(b *Client, cred c2s) *vocab.Actor
- func Collection(b *Client, cred c2s, whichCollection vocab.CollectionPath, ff ...filters.Check) (vocab.Item, error)
- func CollectionBitmap() index.Indexable
- func Delete(ap *client.C, actor vocab.Actor, l lw.Logger, iris ...vocab.IRI) error
- func ExtractCollectionItems(li vocab.LinkOrIRI) []uint64
- func Follow(ap *client.C, actor vocab.Actor, l lw.Logger, iri string, reason string) error
- func FollowResponse(ap *client.C, actor vocab.Actor, l lw.Logger, typ vocab.ActivityVocabularyType, ...) error
- func Follows(b *Client, cred c2s) (vocab.ItemCollection, error)
- func Instance(b *Client, cred c2s) (*vocab.Actor, error)
- func LoadCredentials(b *Client, iri string) (*credentials.C2S, error)
- func LoadIRI(b *Client, cred c2s, iri vocab.IRI) (vocab.Item, error)
- func LoadItems(b *Client, cred c2s, iris ...vocab.IRI) (vocab.ItemCollection, error)
- func Logger(b *Client) lw.Logger
- func Moderate(ap *client.C, actor vocab.Actor, l lw.Logger, m Moderation) error
- func OpenEditor(editor, file, content string) ([]byte, error)
- func PostNote(ap *client.C, actor vocab.Actor, l lw.Logger, ob Object) error
- func Print(item vocab.Item) error
- func PrintActivityFn(s *strings.Builder, fn SearchFn) func(activity *vocab.Activity) error
- func PrintActorFn(s *strings.Builder, fn SearchFn) func(*vocab.Actor) error
- func PrintActorIdentifier(s *strings.Builder, act *vocab.Actor) error
- func PrintIntransitiveActivityFn(s *strings.Builder, fn SearchFn) func(activity *vocab.IntransitiveActivity) error
- func PrintItem(s *strings.Builder, fn SearchFn, it vocab.Item) error
- func PrintItemIdentifier(s *strings.Builder, li vocab.LinkOrIRI) error
- func PrintItemIdentifiers(s *strings.Builder, auth vocab.ItemCollection) error
- func PrintListItem(s *strings.Builder, fn SearchFn, i int, li vocab.LinkOrIRI) error
- func PrintNaturalLanguage(s *strings.Builder, nl vocab.NaturalLanguageValues) error
- func PrintObjectFn(s *strings.Builder, fn SearchFn) func(*vocab.Object) error
- func PrintObjectIdentifier(s *strings.Builder, ob *vocab.Object) error
- func RemoveFromRecipients(it vocab.Item, recipients ...vocab.Item) vocab.Item
- func Save(ap *client.C, l lw.Logger, activities ...vocab.Item) error
- func SaveCredentials(b *Client, cl credentials.C2S) error
- func URLPath(uu string) string
- func Undo(ap *client.C, actor vocab.Actor, l lw.Logger, iris ...string) error
- func Upload(ap *client.C, actor vocab.Actor, l lw.Logger, ats ...Attachment) error
- func UseBasePath(path string) func(*Client) error
- func UseLogger(l lw.Logger) func(b *Client) error
- func UseXDGPaths(app string) func(*Client) error
- func ValidCredentials(cl credentials.C2S) bool
- func WithUserAgent(ua string) func(*Client) error
- func WrapFlattenedObjectInActivityOfType(actor vocab.Actor, typ vocab.ActivityVocabularyType, ob vocab.Item) vocab.Activity
- func WrapObjectInActivityOfType(actor vocab.Actor, typ vocab.ActivityVocabularyType, ob vocab.Item) vocab.Activity
- func WrapObjectInAnnounce(actor vocab.Actor, ob vocab.Item) vocab.Activity
- func WrapObjectInCreate(actor vocab.Actor, ob vocab.Item) vocab.Activity
- func WrapObjectInDelete(actor vocab.Actor, ob vocab.Item) vocab.Activity
- func WrapObjectInUndo(actor vocab.Actor, ob vocab.Item) vocab.Activity
- func WrapObjectInUpdate(actor vocab.Actor, ob vocab.Item) vocab.Activity
- func WriteDataURLFromFile(file *os.File, content io.Writer) error
- type Attachment
- type Client
- func (b *Client) BuildCollectionFetches(ctx context.Context) []Fetch
- func (b *Client) CachePath() string
- func (b *Client) Client(ctx context.Context, cred c2s) *client.C
- func (b *Client) Close() error
- func (b *Client) DataPath() string
- func (b *Client) Follow(ctx context.Context, fetches ...Fetch) error
- func (b *Client) Open() error
- func (b *Client) Save(items ...vocab.Item) error
- func (b *Client) Search(checks ...filters.Check) (vocab.ItemCollection, error)
- func (b *Client) SearchInCollection(col vocab.IRI, checks ...filters.Check) (vocab.ItemCollection, error)
- type Content
- type Fetch
- type Moderation
- type Object
- type SearchFn
- type Storage
- func (st *Storage) AddIndex(it vocab.LinkOrIRI) error
- func (st *Storage) Close() error
- func (st *Storage) Load(iri vocab.IRI) (vocab.LinkOrIRI, error)
- func (st *Storage) Open() error
- func (st *Storage) Save(it vocab.LinkOrIRI) error
- func (st *Storage) Search(checks ...filters.Check) (vocab.ItemCollection, error)
- func (st *Storage) SearchInCollection(col vocab.IRI, checks ...filters.Check) (vocab.ItemCollection, error)
Constants ¶
View Source
const ( ByID = index.ByID ByType = index.ByType ByName = index.ByName ByPreferredUsername = index.ByPreferredUsername BySummary = index.BySummary ByContent = index.ByContent ByActor = index.ByActor ByObject = index.ByObject ByRecipients = index.ByRecipients ByAttributedTo = index.ByAttributedTo ByInReplyTo = index.ByInReplyTo ByPublished = index.ByPublished ByUpdated = index.ByUpdated ByCollection = iota )
Variables ¶
View Source
var ( AppName = "box" AppVersion = "HEAD" AppWebsite = "git.sr.ht/~mariusor/box" )
View Source
var SortFn = vocab.ItemOrderTimestamp
View Source
var Split = []byte{'\n', '\n', '\n'}
View Source
var ValidLikeTypes = vocab.ActivityVocabularyTypes{ vocab.LikeType, vocab.DislikeType, }
View Source
var ValidTypes = vocab.ActivityVocabularyTypes{ vocab.ActivityVocabularyType(""), vocab.AudioType, vocab.ImageType, vocab.VideoType, vocab.PageType, vocab.NoteType, vocab.ArticleType, vocab.DocumentType, vocab.TombstoneType, }
Functions ¶
func Appreciation ¶
func Collection ¶
func CollectionBitmap ¶
CollectionBitmap uses a slightly different logic than a regular index. For collections, instead of storing the item's extracted tokens to the reference of the object's IRI we use the collection IRI as a token, and we store the references to the collection's items in the bitmap.
func ExtractCollectionItems ¶
ExtractCollectionItems returns the vocab.IRI tokens corresponding to the items in the collection of the received vocab.Item
func FollowResponse ¶
func LoadCredentials ¶
func LoadCredentials(b *Client, iri string) (*credentials.C2S, error)
func OpenEditor ¶
func PrintActivityFn ¶
func PrintItemIdentifiers ¶
func PrintItemIdentifiers(s *strings.Builder, auth vocab.ItemCollection) error
func PrintListItem ¶
func PrintNaturalLanguage ¶
func PrintNaturalLanguage(s *strings.Builder, nl vocab.NaturalLanguageValues) error
func RemoveFromRecipients ¶
func SaveCredentials ¶
func SaveCredentials(b *Client, cl credentials.C2S) error
func UseBasePath ¶
func UseXDGPaths ¶
func ValidCredentials ¶
func ValidCredentials(cl credentials.C2S) bool
func WithUserAgent ¶
func WrapObjectInAnnounce ¶
Types ¶
type Attachment ¶
type Attachment struct { Content Exists bool ID vocab.IRI Type string Recipients vocab.IRIs InReplyTo vocab.IRIs File map[string]*os.File Sizes map[string]image.Point // contains filtered or unexported fields }
func LoadMediaObject ¶
func LoadMediaObject(b *Client, cred c2s, iris ...vocab.IRI) ([]Attachment, error)
func (Attachment) Original ¶
func (a Attachment) Original() *os.File
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BuildCollectionFetches ¶
func (*Client) SearchInCollection ¶
type Content ¶
type Content struct { Name vocab.NaturalLanguageValues Summary vocab.NaturalLanguageValues Content vocab.NaturalLanguageValues }
func FromTemplate ¶
type Moderation ¶
type Moderation struct { Type vocab.ActivityVocabularyType Reason vocab.NaturalLanguageValues Targets vocab.IRIs }
type Object ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) SearchInCollection ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.