types

package
v0.0.0-...-b83fd72 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package types contains common types used across the backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountStateToAccountProto

func AccountStateToAccountProto(accountState *stpb.AccountState) *pb.Account

func SettingListCount

func SettingListCount(s *settingspb.Settings) int64

func StreamStateToStreamInfo

func StreamStateToStreamInfo(ss *stpb.StreamState) *pb.StreamInfo

Types

type ASID

type ASID int64

ASID is an AccountState ID.

type AppRegInfo

type AppRegInfo struct {
	// Mastodon server address.
	ServerAddr string `json:"server_addr"`
	// Scopes used when registering the app.
	Scopes string `json:"scopes"`
	// Where the oauth should redirect - incl. /_redirect.
	RedirectURI string `json:"redirect_uri"`
}

AppRegInfo is what identify a given app registration on a Mastodon server. It is used to identify which app registration is needed when interacting with a Mastodon server. It is not serialized - see AppRegState for that. AppRegState is a strict superset.

func (*AppRegInfo) Key

func (nfo *AppRegInfo) Key() string

Key computes a string key for that entry, for indexing. It is unique for a given AppRegKey content.

type SID

type SID int64

SID is the type of status IDs in `statuses` and `streamcontent` databases.

type SQLProto

type SQLProto struct {
	proto.Message
}

SQLProto encapsulate a protobuf message to make suitable as value of SQL queries - both as source data and as destination data. E.g.,: SQLProto{myMsg}

func (SQLProto) Scan

func (m SQLProto) Scan(src any) error

Scan implements the [sql.Scanner] interface.

func (SQLProto) Value

func (m SQLProto) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type SQLStatus

type SQLStatus struct {
	mastodon.Status
}

SQLStatus encapsulate a mastodon status to allow for easier SQL serialization, as it is not possible to add it on the original type on the Mastodon library.

func (*SQLStatus) Scan

func (ss *SQLStatus) Scan(src any) error

Scan implements the [Scanner] interface.

func (*SQLStatus) Value

func (ss *SQLStatus) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type StID

type StID int64

StID is a StreamState ID.

type UID

type UID int64

UID is a UserState ID.

Jump to

Keyboard shortcuts

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