mast

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeOk                  CmdReturnCode = 0
	CodeNotOk                             = 1
	CodeCommandNotFound                   = 2
	CodeUserNotFound                      = 3
	CodeTriggerNotSupported               = 4

	CodeQuit = -1
	CodeHelp = -2
)
View Source
const (
	TriggerCLI = 0
	TriggerTUI = 1
)
View Source
const (
	TimelineHome          TimelineType = 0
	TimelineLocal                      = 1
	TimelinePublic                     = 2
	TimelineNotifications              = 3
	TimelineHashtag                    = 4
	TimelineUser                       = 5
)
View Source
const (
	VisibilityPublic   string = "public"
	VisibilityPrivate         = "private"
	VisibilityUnlisted        = "unlisted"
	VisibilityDirect          = "direct"
)

Variables

View Source
var CmdContentRegex = regexp.MustCompile(`(?m)(( {0,1}~#| {0,1}~:)\[([^\[\]]*)\]| {0,1}~!!)`)
View Source
var CmdHandleAutoCompletionRegex = regexp.MustCompile(`(?m)(^@| @|^whois @{0,1})([^ ]+)$`)

Functions

func CmdAutocompleter

func CmdAutocompleter(input string, knownUsers map[string]string) []string

func CmdAvailable

func CmdAvailable() []string

func CmdHelperGetBoostParams

func CmdHelperGetBoostParams(args string) (int, error)

func CmdHelperGetFavParams

func CmdHelperGetFavParams(args string) (int, error)

func CmdHelperGetHashtagParams added in v0.2.0

func CmdHelperGetHashtagParams(args string) (string, bool, error)

func CmdHelperGetOpenParams

func CmdHelperGetOpenParams(args string) (int, error)

func CmdHelperGetReplyParams

func CmdHelperGetReplyParams(args string) (int, string, error)

func CmdHelperGetShareParams

func CmdHelperGetShareParams(args string) (int, error)

func CmdHelperGetTootIDFromString

func CmdHelperGetTootIDFromString(s string) (int, error)

Types

type CmdReturnCode

type CmdReturnCode int

func CmdBoost

func CmdBoost(timeline *Timeline, tootID int) CmdReturnCode

func CmdFav

func CmdFav(timeline *Timeline, tootID int) CmdReturnCode

func CmdOpen

func CmdOpen(timeline *Timeline, tootID int) CmdReturnCode

func CmdProcessor

func CmdProcessor(timeline *Timeline, input string, trigger CmdTrigger) (CmdReturnCode, bool)

func CmdShare

func CmdShare(timeline *Timeline, tootID int) CmdReturnCode

func CmdToot

func CmdToot(
	timeline *Timeline,
	content string,
	inReplyTo int,
	visibility string) CmdReturnCode

func CmdUnboost

func CmdUnboost(timeline *Timeline, tootID int) CmdReturnCode

func CmdUnfav

func CmdUnfav(timeline *Timeline, tootID int) CmdReturnCode

type CmdTrigger added in v0.3.0

type CmdTrigger int

type Timeline

type Timeline struct {
	LastRenderedIndex int

	Account                   mastodon.Account
	Toots                     []Toot
	TootIndexStatusIDMappings map[string]int
	KnownUsers                map[string]string
	// contains filtered or unexported fields
}

func NewTimeline

func NewTimeline(mastodonClient *mastodon.Client) Timeline

func (*Timeline) Boost

func (timeline *Timeline) Boost(
	tootID int,
	shallBe bool) (*mastodon.Status, error)

func (*Timeline) Fav

func (timeline *Timeline) Fav(
	tootID int,
	shallBe bool) (*mastodon.Status, error)

func (*Timeline) GetCurrentOptions added in v0.2.0

func (timeline *Timeline) GetCurrentOptions() TimelineOptions

func (*Timeline) GetCurrentType

func (timeline *Timeline) GetCurrentType() TimelineType

func (*Timeline) Load

func (timeline *Timeline) Load() error

func (*Timeline) SearchUser added in v0.2.0

func (timeline *Timeline) SearchUser(
	query string,
	limit int64) ([]*mastodon.Account, error)

func (*Timeline) Switch

func (timeline *Timeline) Switch(timelineType TimelineType, options *TimelineOptions)

func (*Timeline) Toot

func (timeline *Timeline) Toot(
	status *string,
	inReplyTo int,
	filesToUpload []string,
	visibility *string,
	sensitive bool,
	spoiler *string) (*mastodon.Status, error)

func (*Timeline) User added in v0.2.0

func (timeline *Timeline) User(
	ID string) (*mastodon.Account, error)

type TimelineOptions added in v0.2.0

type TimelineOptions struct {
	IsLocal bool
	Hashtag string
	User    mastodon.Account
}

type TimelineType

type TimelineType int

type Toot

type Toot struct {
	ID     int
	Status mastodon.Status

	IsNotification bool
	Notification   mastodon.Notification
	// contains filtered or unexported fields
}

func NewToot

func NewToot(
	mastodonClient *mastodon.Client,
	mastodonStatus *mastodon.Status,
	mastodonNotification *mastodon.Notification,
	id int) Toot

Jump to

Keyboard shortcuts

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