Documentation
¶
Index ¶
- Variables
- func BuildActivityApplication(actor *Actor, config *instance.FederationConfig) vocab.ActivityStreamsApplication
- func CreateCreateActivity(id string, instanceIri *url.URL, localActorIRI *url.URL) vocab.ActivityStreamsCreate
- func GetFullUsernameFromExternalEntity(entity ExternalEntity) string
- func MakeActivityDirect(activity vocab.ActivityStreamsCreate, toIRI *url.URL) vocab.ActivityStreamsCreate
- func MakeActivityPublic(activity vocab.ActivityStreamsCreate, isPrivate bool) vocab.ActivityStreamsCreate
- func MakeCreateActivity(activityID *url.URL) vocab.ActivityStreamsCreate
- func MakeNote(text string, noteIRI *url.URL, attributedToIRI *url.URL) vocab.ActivityStreamsNote
- func MakeNoteDirect(note vocab.ActivityStreamsNote, toIRI *url.URL) vocab.ActivityStreamsNote
- func MakeNotePublic(note vocab.ActivityStreamsNote) vocab.ActivityStreamsNote
- func MakeUpdateActivity(activityID *url.URL, isPrivate bool) vocab.ActivityStreamsUpdate
- func Serialize(obj vocab.Type) ([]byte, error)
- type Actor
- func MakeActorFromExernalAPEntity(entity ExternalEntity) (*Actor, error)
- func NewChannelActor(instanceUrl *url.URL, name string) (*Actor, error)
- func NewInstanceActor(instanceUrl *url.URL, name string) (*Actor, error)
- func NewPersonActor(instanceUrl *url.URL, name string) (*Actor, error)
- func NewTrustedInstanceActor(actorIri *url.URL, name string) (*Actor, error)
- type ActorRepository
- func (r *ActorRepository) Add(_ context.Context, actor *Actor) (*Actor, error)
- func (r *ActorRepository) GetActorByActorIRI(ctx context.Context, actorIri *url.URL) (*Actor, error)
- func (r *ActorRepository) GetActorForIRI(ctx context.Context, iri *url.URL, iriType IriType) (*Actor, error)
- func (r *ActorRepository) GetActorForUserName(ctx context.Context, name string) (*Actor, error)
- func (r *ActorRepository) GetAllActorsByIds(ctx context.Context, actorIds []uint) ([]*Actor, error)
- func (r *ActorRepository) GetKeyPair(ctx context.Context, actorIRI *url.URL) (publicKey string, privateKey string, err error)
- func (r *ActorRepository) GetPrivateKey(ctx context.Context, actorIRI *url.URL) (string, error)
- func (r *ActorRepository) GetPublicKey(ctx context.Context, actorIRI *url.URL) (string, error)
- func (r *ActorRepository) Upsert(ctx context.Context, actor *Actor) (*Actor, error)
- type ActorType
- type ExternalEntity
- type Follow
- type FollowRepository
- func (r *FollowRepository) Add(ctx context.Context, follow *Follow) (*Follow, error)
- func (r *FollowRepository) GetActorFollowers(ctx context.Context, actorId uint) ([]*Follow, error)
- func (r *FollowRepository) GetActorFollowsFromActorId(ctx context.Context, actorId uint) ([]*Follow, error)
- func (r *FollowRepository) GetFollowByIri(ctx context.Context, iri string) (*Follow, error)
- func (r *FollowRepository) Update(ctx context.Context, follow *Follow) (*Follow, error)
- func (r *FollowRepository) UpdateFollower(ctx context.Context, falower *Follow) error
- type FollowState
- type Instance
- type InstanceRepository
- type IriType
- type LiveVideoLatencyMode
- type PrivacyAudience
- type Video
- type VideoRepository
- type VideoState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorNoPreferredUsername = errors.New("remote activitypub entity does not have a preferred username set, rejecting") ErrorNoPublicKey = errors.New("remote activitypub entity does not have a public key set, rejecting") )
View Source
var ErrActorFollowNotFound = errors.New("actor follow not found")
View Source
var ErrActorNotFound = errors.New("actor not found")
View Source
var ErrInstanceNotFound = errors.New("reading unknown instance from store")
Functions ¶
func BuildActivityApplication ¶
func BuildActivityApplication(actor *Actor, config *instance.FederationConfig) vocab.ActivityStreamsApplication
func CreateCreateActivity ¶
func GetFullUsernameFromExternalEntity ¶
func GetFullUsernameFromExternalEntity(entity ExternalEntity) string
func MakeActivityDirect ¶
func MakeActivityDirect(activity vocab.ActivityStreamsCreate, toIRI *url.URL) vocab.ActivityStreamsCreate
MakeActivityDirect sets the required properties to make this activity seen as a direct message.
func MakeActivityPublic ¶
func MakeActivityPublic(activity vocab.ActivityStreamsCreate, isPrivate bool) vocab.ActivityStreamsCreate
MakeActivityPublic sets the required properties to make this activity seen as public.
func MakeCreateActivity ¶
func MakeCreateActivity(activityID *url.URL) vocab.ActivityStreamsCreate
MakeCreateActivity will return a new Create activity with the provided ID.
func MakeNoteDirect ¶
func MakeNoteDirect(note vocab.ActivityStreamsNote, toIRI *url.URL) vocab.ActivityStreamsNote
MakeNoteDirect sets the required properties to make this note seen as a direct message.
func MakeNotePublic ¶
func MakeNotePublic(note vocab.ActivityStreamsNote) vocab.ActivityStreamsNote
MakeNotePublic ses the required proeprties to make this note seen as public.
func MakeUpdateActivity ¶
func MakeUpdateActivity(activityID *url.URL, isPrivate bool) vocab.ActivityStreamsUpdate
MakeUpdateActivity will return a new Update activity with the provided aID.
Types ¶
type Actor ¶
type Actor struct { ActorType string `gorm:""` PublicKey string `gorm:""` PrivateKey sql.NullString `gorm:""` ActorIri string `gorm:"index;unique;"` FollowingIri string `gorm:""` FollowersIri string `gorm:""` InboxIri string `gorm:""` OutboxIri string `gorm:""` DisabledAt sql.NullTime `gorm:""` ServerId sql.NullInt64 `gorm:""` RemoteCreatedAt time.Time `gorm:""` PreferredUsername string `gorm:""` Follower []*Follow `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` Following []*Follow `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` VideoGuest []*Video `gorm:"many2many:video_guests;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` gorm.Model }
func MakeActorFromExernalAPEntity ¶
func MakeActorFromExernalAPEntity(entity ExternalEntity) (*Actor, error)
MakeActorFromExernalAPEntity takes a full ActivityPub entity and returns our internal representation of an actor.
func NewTrustedInstanceActor ¶
func (*Actor) GetActorIri ¶
func (*Actor) GetActorType ¶
func (*Actor) GetInboxIri ¶
func (*Actor) GetOutboxIri ¶
func (*Actor) GetSharedInboxIri ¶
type ActorRepository ¶
type ActorRepository struct {
// contains filtered or unexported fields
}
func NewActorRepository ¶
func NewActorRepository(config *instance.FederationConfig, storage storage.Storage) *ActorRepository
func (*ActorRepository) GetActorByActorIRI ¶
func (*ActorRepository) GetActorForIRI ¶
func (r *ActorRepository) GetActorForIRI(ctx context.Context, iri *url.URL, iriType IriType) (*Actor, error)
GetActorForIRI @deprecated
func (*ActorRepository) GetActorForUserName ¶
func (*ActorRepository) GetAllActorsByIds ¶
func (*ActorRepository) GetKeyPair ¶
func (*ActorRepository) GetPrivateKey ¶
func (*ActorRepository) GetPublicKey ¶
type ExternalEntity ¶
type ExternalEntity interface { GetJSONLDId() vocab.JSONLDIdProperty GetActivityStreamsInbox() vocab.ActivityStreamsInboxProperty GetActivityStreamsName() vocab.ActivityStreamsNameProperty GetActivityStreamsPreferredUsername() vocab.ActivityStreamsPreferredUsernameProperty GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty GetW3IDSecurityV1PublicKey() vocab.W3IDSecurityV1PublicKeyProperty }
type Follow ¶
type Follow struct { Iri string `gorm:"iri;not null;index;"` ActorId uint `gorm:"actor_id;not null;"` TargetActorId uint `gorm:"target_actor_id;not null;"` State string `gorm:"state;not null;"` Actor *Actor `gorm:"foreignKey:ActorId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` TargetActor *Actor `gorm:"foreignKey:TargetActorId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` gorm.Model // contains filtered or unexported fields }
type FollowRepository ¶
type FollowRepository struct {
// contains filtered or unexported fields
}
func NewFollowRepository ¶
func NewFollowRepository(config *instance.FederationConfig, storage storage.Storage) *FollowRepository
func (*FollowRepository) GetActorFollowers ¶
func (*FollowRepository) GetActorFollowsFromActorId ¶
func (*FollowRepository) GetFollowByIri ¶
func (*FollowRepository) UpdateFollower ¶
func (r *FollowRepository) UpdateFollower(ctx context.Context, falower *Follow) error
type FollowState ¶
type FollowState uint
const ( Accepted FollowState = iota Pending Rejected )
func (FollowState) String ¶
func (fs FollowState) String() string
type Instance ¶
type Instance struct { ActorId uint `gorm:"not null;unique;"` Actor *Actor `gorm:"foreignKey:ActorId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` gorm.Model }
func NewInstance ¶
type InstanceRepository ¶
type InstanceRepository struct {
// contains filtered or unexported fields
}
func NewInstanceRepository ¶
func NewInstanceRepository(config *instance.FederationConfig, storage storage.Storage) *InstanceRepository
func (*InstanceRepository) GetInstanceByActorIri ¶
type LiveVideoLatencyMode ¶
type LiveVideoLatencyMode uint
const ( DEFAULT LiveVideoLatencyMode = iota HIGH_LATENCY SMALL_LATENCY )
type PrivacyAudience ¶
type PrivacyAudience = string
const ( // PUBLIC is an audience meaning anybody can view the item. PUBLIC PrivacyAudience = "https://www.w3.org/ns/activitystreams#Public" )
type Video ¶
type Video struct { Iri string `gorm:"not null;index;unique;"` Uuid string `gorm:"not null;index;unique;"` Name string `gorm:""` ShigActive bool `gorm:"not null;default:false;"` InstanceId uint `gorm:"not null;"` Instance *Instance `gorm:"foreignKey:InstanceId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` OwnerId uint `gorm:"not null;"` Owner *Actor `gorm:"foreignKey:OwnerId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` ChannelId uint `gorm:"not null;"` Channel *Actor `gorm:"foreignKey:ChannelId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` Guests []*Actor `gorm:"many2many:video_guests;"` IsLiveBroadcast bool `gorm:"not null;default:false;"` LiveSaveReplay bool `gorm:"not null;default:false;"` PermanentLive bool `gorm:""` LatencyMode uint `gorm:"not null;default:1;"` Published sql.NullTime `gorm:""` State uint `gorm:"not null;default:0"` gorm.Model // contains filtered or unexported fields }
func (*Video) GetLatencyMode ¶
func (s *Video) GetLatencyMode() LiveVideoLatencyMode
func (*Video) GetState ¶
func (s *Video) GetState() VideoState
func (*Video) GetVideoIri ¶
type VideoRepository ¶
type VideoRepository struct {
// contains filtered or unexported fields
}
func NewVideoRepository ¶
func NewVideoRepository(config *instance.FederationConfig, storage storage.Storage) *VideoRepository
func (*VideoRepository) DeleteByIri ¶
func (r *VideoRepository) DeleteByIri(ctx context.Context, iri string) error
type VideoState ¶
type VideoState uint
const ( PUBLISHED VideoState = iota TO_TRANSCODE TO_IMPORT WAITING_FOR_LIVE LIVE_ENDED TO_MOVE_TO_EXTERNAL_STORAGE TRANSCODING_FAILED TO_MOVE_TO_EXTERNAL_STORAGE_FAILED TO_EDIT )
Click to show internal directories.
Click to hide internal directories.