types

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountStats

type AccountStats struct {
	Follows   []string `json:"follows"`
	Followers []string `json:"followers"`
}

type ApConfig

type ApConfig struct {
	FQDN      string `yaml:"fqdn"`
	ProxyPriv string `yaml:"proxyPriv"`

	// internal generated
	ProxyCCID string
}

type ApEntity

type ApEntity struct {
	ID          string         `json:"id" gorm:"type:text"`
	CCID        string         `json:"ccid" gorm:"type:char(42)"`
	Enabled     bool           `json:"enabled" gorm:"type:bool;default:true"`
	Publickey   string         `json:"publickey" gorm:"type:text"`
	Privatekey  string         `json:"privatekey" gorm:"type:text"`
	AlsoKnownAs pq.StringArray `json:"aliases" gorm:"type:text[]"`
}

ApEntity is a db model of an ActivityPub entity.

type ApFollow

type ApFollow struct {
	ID                 string `json:"id" gorm:"type:text"`
	Accepted           bool   `json:"accepted" gorm:"type:bool"`
	PublisherPersonURL string `json:"publisher" gorm:"type:text"`  // ActivityPub Person
	SubscriberUserID   string `json:"subscriber" gorm:"type:text"` // Concurrent APID
}

ApFollow is a db model of an ActivityPub follow. Concurrent -> Activitypub

type ApFollower

type ApFollower struct {
	ID                  string `json:"id" gorm:"type:text"`
	SubscriberPersonURL string `json:"subscriber" gorm:"type:text;uniqueIndex:uniq_apfollower;"` // ActivityPub Person
	PublisherUserID     string `json:"publisher" gorm:"type:text;uniqueIndex:uniq_apfollower;"`  // Concurrent APID
	SubscriberInbox     string `json:"subscriber_inbox" gorm:"type:text"`                        // ActivityPub Inbox
}

ApFollwer is a db model of an ActivityPub follower. Activitypub -> Concurrent

type ApObject

type ApObject struct {
	Context           any              `json:"@context,omitempty"`
	Actor             string           `json:"actor,omitempty"`
	Type              string           `json:"type,omitempty"`
	ID                string           `json:"id,omitempty"`
	To                any              `json:"to,omitempty"`
	CC                any              `json:"cc,omitempty"`
	Tag               any              `json:"tag,omitempty"`
	Attachment        []Attachment     `json:"attachment,omitempty"`
	InReplyTo         string           `json:"inReplyTo,omitempty"`
	Content           string           `json:"content,omitempty"`
	MisskeyContent    string           `json:"_misskey_content,omitempty"`
	Published         string           `json:"published,omitempty"`
	AttributedTo      string           `json:"attributedTo,omitempty"`
	QuoteURL          string           `json:"quoteUrl,omitempty"`
	Inbox             string           `json:"inbox,omitempty"`
	Outbox            string           `json:"outbox,omitempty"`
	SharedInbox       string           `json:"sharedInbox,omitempty"`
	Endpoints         *PersonEndpoints `json:"endpoints,omitempty"`
	Followers         string           `json:"followers,omitempty"`
	Following         string           `json:"following,omitempty"`
	Liked             string           `json:"liked,omitempty"`
	PreferredUsername string           `json:"preferredUsername,omitempty"`
	Name              string           `json:"name,omitempty"`
	Summary           string           `json:"summary,omitempty"`
	URL               string           `json:"url,omitempty"`
	Icon              *Icon            `json:"icon,omitempty"`
	PublicKey         *Key             `json:"publicKey,omitempty"`
	Object            any              `json:"object,omitempty"`
	Sensitive         bool             `json:"sensitive,omitempty"`
	AlsoKnownAs       []string         `json:"alsoKnownAs,omitempty"`
}

type ApObjectReference

type ApObjectReference struct {
	ApObjectID string `json:"apobjectID" gorm:"primaryKey;type:text;"`
	CcObjectID string `json:"ccobjectID" gorm:"type:text;"`
}

ApObjectReference is a db model of an ActivityPub object cross reference.

type ApUserSettings

type ApUserSettings struct {
	CCID            string         `json:"ccid" gorm:"type:char(42);primaryKey"`
	ListenTimelines pq.StringArray `json:"listen_timelines" gorm:"type:text[]"`
}

type Attachment

type Attachment struct {
	Type      string `json:"type,omitempty"`
	MediaType string `json:"mediaType,omitempty"`
	URL       string `json:"url,omitempty"`
	Sensitive bool   `json:"sensitive,omitempty"`
}

Attachment is a struct for an ActivityPub attachment.

type Icon

type Icon struct {
	Type      string `json:"type,omitempty"`
	MediaType string `json:"mediaType,omitempty"`
	URL       string `json:"url,omitempty"`
}

Icon is a struct for the icon field of an actor.

type Key

type Key struct {
	ID           string `json:"id,omitempty"`
	Type         string `json:"type,omitempty"`
	Owner        string `json:"owner,omitempty"`
	PublicKeyPem string `json:"publicKeyPem,omitempty"`
}

Key is a struct for the publicKey field of an actor.

type NodeInfo

type NodeInfo struct {
	Version           string           `json:"version,omitempty" yaml:"version"`
	Software          NodeInfoSoftware `json:"software,omitempty" yaml:"software"`
	Protocols         []string         `json:"protocols,omitempty" yaml:"protocols"`
	OpenRegistrations bool             `json:"openRegistrations,omitempty" yaml:"openRegistrations"`
	Metadata          NodeInfoMetadata `json:"metadata,omitempty" yaml:"metadata"`
}

NodeInfo is a struct for a NodeInfo response.

type NodeInfoMetadata

type NodeInfoMetadata struct {
	NodeName        string                     `json:"nodeName,omitempty" yaml:"nodeName"`
	NodeDescription string                     `json:"nodeDescription,omitempty" yaml:"nodeDescription"`
	Maintainer      NodeInfoMetadataMaintainer `json:"maintainer,omitempty" yaml:"maintainer"`
	ThemeColor      string                     `json:"themeColor,omitempty" yaml:"themeColor"`
	ProxyCCID       string                     `json:"proxyCCID,omitempty" yaml:"proxyCCID"`
}

NodeInfoMetadata is a struct for the metadata field of a NodeInfo response.

type NodeInfoMetadataMaintainer

type NodeInfoMetadataMaintainer struct {
	Name  string `json:"name,omitempty" yaml:"name"`
	Email string `json:"email,omitempty" yaml:"email"`
}

NodeInfoMetadataMaintainer is a struct for the maintainer field of a NodeInfo response.

type NodeInfoSoftware

type NodeInfoSoftware struct {
	Name    string `json:"name,omitempty" yaml:"name"`
	Version string `json:"version,omitempty" yaml:"version"`
}

NodeInfoSoftware is a struct for the software field of a NodeInfo response.

type PersonEndpoints

type PersonEndpoints struct {
	SharedInbox string `json:"sharedInbox,omitempty"`
}

type RawApObj added in v0.4.3

type RawApObj struct {
	// contains filtered or unexported fields
}

func LoadAsRawApObj added in v0.4.3

func LoadAsRawApObj(jsonBytes []byte) (*RawApObj, error)

func (*RawApObj) GetBool added in v0.4.3

func (r *RawApObj) GetBool(key string) (bool, bool)

func (*RawApObj) GetData added in v0.4.3

func (r *RawApObj) GetData() map[string]any

func (*RawApObj) GetRaw added in v0.4.3

func (r *RawApObj) GetRaw(key string) (*RawApObj, bool)

func (*RawApObj) GetRawSlice added in v0.4.3

func (r *RawApObj) GetRawSlice(key string) ([]*RawApObj, bool)

func (*RawApObj) GetString added in v0.4.3

func (r *RawApObj) GetString(key string) (string, bool)

func (*RawApObj) GetStringSlice added in v0.4.3

func (r *RawApObj) GetStringSlice(key string) ([]string, bool)

func (*RawApObj) MustGetBool added in v0.4.3

func (r *RawApObj) MustGetBool(key string) bool

func (*RawApObj) MustGetRaw added in v0.4.3

func (r *RawApObj) MustGetRaw(key string) *RawApObj

func (*RawApObj) MustGetRawSlice added in v0.4.3

func (r *RawApObj) MustGetRawSlice(key string) []*RawApObj

func (*RawApObj) MustGetString added in v0.4.3

func (r *RawApObj) MustGetString(key string) string

func (*RawApObj) MustGetStringSlice added in v0.4.3

func (r *RawApObj) MustGetStringSlice(key string) []string

func (*RawApObj) Print added in v0.4.3

func (r *RawApObj) Print()

type Tag

type Tag struct {
	Type string `json:"type,omitempty"`
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	Icon *Icon  `json:"icon,omitempty"`
	Href string `json:"href,omitempty"`
}

Tag is a struct for an ActivityPub tag.

type WebFinger

type WebFinger struct {
	Subject string          `json:"subject"`
	Links   []WebFingerLink `json:"links"`
}

WebFinger is a struct for a WebFinger response.

type WebFingerLink struct {
	Rel  string `json:"rel"`
	Type string `json:"type"`
	Href string `json:"href"`
}

WebFingerLink is a struct for the links field of a WebFinger response.

type WellKnown

type WellKnown struct {
	// Subject string `json:"subject"`
	Links []WellKnownLink `json:"links"`
}

WellKnown is a struct for a well-known response.

type WellKnownLink struct {
	Rel  string `json:"rel"`
	Href string `json:"href"`
}

WellKnownLink is a struct for the links field of a well-known response.

Jump to

Keyboard shortcuts

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