Documentation ¶
Index ¶
- func Authorize(ctx context.Context, credentials_ *Credentials) error
- func CreateClient(credentials *Credentials) (*mastodon.Client, error)
- func CreateClientAndAuthenticate(ctx context.Context, credentials *Credentials) (*mastodon.Client, error)
- func ExtractID(status string) string
- func InitConfig()
- func StoreCredentials(credentials *Credentials) error
- type Credentials
- type Node
- type Thread
- func (t *Thread) AddContextAndGetMissingIDs(id mastodon.ID, context *mastodon.Context)
- func (t *Thread) AddStatus(status *mastodon.Status)
- func (t *Thread) GetNode(id mastodon.ID) *Node
- func (t *Thread) GetRoots() []*Node
- func (t *Thread) OutputToProcessor(ctx context.Context, gp middlewares.Processor) error
- func (t *Thread) WalkBreadthFirst(f func(n *Node, depth int, siblingIdx int) error) error
- func (t *Thread) WalkDepthFirst(f func(n *Node, depth int, siblingIdx int) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
func CreateClient(credentials *Credentials) (*mastodon.Client, error)
func CreateClientAndAuthenticate ¶
func CreateClientAndAuthenticate(ctx context.Context, credentials *Credentials) (*mastodon.Client, error)
func InitConfig ¶
func InitConfig()
func StoreCredentials ¶
func StoreCredentials(credentials *Credentials) error
Types ¶
type Credentials ¶
type Credentials struct { Server string GrantToken string Application *mastodon.Application AccessToken string }
Credentials stores the result of an oauth flow.
func LoadCredentials ¶
func LoadCredentials() (*Credentials, error)
type Node ¶
type Node struct { ID mastodon.ID Ancestors *orderedmap.OrderedMap[mastodon.ID, *Node] Descendants *orderedmap.OrderedMap[mastodon.ID, *Node] Status *mastodon.Status }
type Thread ¶
type Thread struct {
Nodes map[mastodon.ID]*Node
}
func (*Thread) AddContextAndGetMissingIDs ¶
func (t *Thread) AddContextAndGetMissingIDs(id mastodon.ID, context *mastodon.Context)
AddContextAndGetMissingIDs adds the given context of the given status to the thread. Returns the list of missing IDs to be added.
func (*Thread) GetNode ¶
GetNode returns the tree node for the given ID, creating it if not already present.
func (*Thread) GetRoots ¶
GetRoots returns the roots (nodes without ancestors) of the thread, in order.
func (*Thread) OutputToProcessor ¶
func (*Thread) WalkBreadthFirst ¶
WalkBreadthFirst walks the thread in order, calling the given function on each node.
Click to show internal directories.
Click to hide internal directories.