Documentation ¶
Index ¶
- Constants
- func Run() error
- type Actor
- type Actors
- func NewAccountUsername(preferredUsername string) *Actors
- func NewActorAddress(address string) *Actors
- func NewActors(preferredUsername, publicKey, actorType string) *Actors
- func NewActorsId(id uint) *Actors
- func NewActorsIsExist(domain, preferredUsername string) *Actors
- func NewAddActors(...) *Actors
- func NewChannels(preferredUsername, publicKey, actorType string) *Actors
- func NewPreferredUsername(preferredUsername string) *Actors
- func NewPreferredUsernameAndDomain(preferredUsername, domain string) *Actors
- func (a *Actors) AddActor() (*Actors, error)
- func (a *Actors) Create() (*Actors, error)
- func (a *Actors) Delete() error
- func (a *Actors) Edit() error
- func (a *Actors) Get() (*Actors, error)
- func (a *Actors) GetActorByAddress() (*Actors, error)
- func (a *Actors) GetActorByUsername() (*Actors, error)
- func (a *Actors) GetActorsByPreferredUsername() ([]*Actors, error)
- func (a *Actors) IsExist() (*Actors, bool)
Constants ¶
View Source
const ( AccountsTable = "accounts" ActorsTable = "actors" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Actor ¶
type Actor interface { // IsExist Actor exists or not. IsExist() (*Actors, bool) // Create Actor. Create() (*Actors, error) // Get Actor. Get() (*Actors, error) // GetActorsByPreferredUsername Get Actors by preferred username. GetActorsByPreferredUsername() ([]*Actors, error) // AddActor Add Actor. // Used when saving users from other instances to this instance. AddActor() (*Actors, error) // GetActorByUsername Get Actor by username. GetActorByUsername() (*Actors, error) // Edit Actor. Edit() error // Delete Actor. Delete() error }
type Actors ¶
type Actors struct { gorm.Model // PreferredUsername is the preferred username for the actor. // The username is stored for multiple instances, so it is repeatable. PreferredUsername string `gorm:"primaryKey;type:text;preferred_username;"` // Domain name of the instance, // for example: https://example.com, example.com is the domain name. Domain string `gorm:"index;type:text;domain"` // Avatar is the URL of the avatar image. it can also be an empty string. Avatar string `gorm:"type:text;avatar"` // Name is the name of the actor, for example: John Doe. Name string `gorm:"type:text;name"` // Summary is a description of the actor. It will become a comprehensive description of the actor. Summary string `gorm:"type:text;summary"` // Inbox is the URL of the actor's inbox, // for example: https://halfmemories.com/u/hvturingga/inbox. Inbox string `gorm:"type:text;inbox"` // Outbox is the URL of the actor's outbox, // for example: https://halfmemories.com/u/hvturingga/outbox. Address string `gorm:"index;test;address"` // PublicKey is the public key of the actor. It is used to verify the signature of the actor. PublicKey string `gorm:"type:text;public_key"` // ActorType is the type of the actor. It is used to determine the type of the actor. ActorType string `gorm:"type:text;actor_type"` // IsRemote is a flag indicating whether the actor is a remote actor or not. // Remote participants are still stored in the database. // Used to indicate whether the actor's account is in the current instance. IsRemote bool `gorm:"type:boolean;is_remote"` }
Actors is a struct that represents a role in the ActivityPub social system.
func NewAccountUsername ¶
NewAccountUsername The constructor is used to get an Actor by username.
func NewActorAddress ¶
NewActorAddress The constructor is used to get an Actor by address.
func NewActorsId ¶
NewActorsId Instantiates the constructor of an ActorsId.
func NewActorsIsExist ¶
NewActorsIsExist Determines if the Actor exists in the constructor of the current instance.
func NewAddActors ¶
func NewAddActors(preferredUsername, domain, avatar, name, summary, inbox, address, publicKey, actorType string) *Actors
NewAddActors The constructor is used to add a new Actor.
func NewChannels ¶
func NewPreferredUsername ¶
NewPreferredUsername The constructor creates a new PreferredUsername.
func (*Actors) GetActorByAddress ¶
func (*Actors) GetActorByUsername ¶
func (*Actors) GetActorsByPreferredUsername ¶
Click to show internal directories.
Click to hide internal directories.