Documentation ¶
Index ¶
- func Run() error
- type Account
- type AccountAuth
- type Accounts
- type Actor
- type Actors
- func (a *Actors) AddActor() (*Actors, error)
- func (a *Actors) FindActorByAccountUsername() (*Actors, error)
- func (a *Actors) FindActorByID() (*Actors, error)
- func (a *Actors) FindActorByUrl() (*Actors, error)
- func (a *Actors) FindByPreferredUsername() (*[]Actors, error)
- func (a *Actors) NewActor() (*Actors, error)
- func (a *Actors) Update() error
- type Follow
- type Follows
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountAuth ¶
type AccountAuth interface { // Login to the account and generate token, Return token and custom error message. Login() (string, error) }
AccountAuth The interface for account authorization, including method interfaces for login or developer API permissions.
func NewAuth ¶
func NewAuth(mail string, password string) AccountAuth
type Accounts ¶
type Accounts struct { gorm.Model Username string `gorm:"primaryKey;type:text;preferredUsername;" validate:"required,min=4,max=16"` Mail string `gorm:"index;type:text;mail;unique" validate:"required,email"` Password string `gorm:"type:text;password" validate:"required,min=8,max=100"` // When creating an account, first verify the username, email address, and password. // After the verification is successful, store the username and key in the actors table, // then use the returned ActorID in this field, and then store the data in the accounts table . // At this time, the context of creating the user is complete. ActorID uint `gorm:"type:bigint;actor_id"` // Whether to set as a private account IsPrivate bool `gorm:"type:boolean;is_private"` PrivateKey string `gorm:"type:text;private_key"` }
func NewAccountsName ¶
func NewAcctNameANDActorID ¶
func (*Accounts) FindAccountByUsername ¶
func (*Accounts) UpdateUsername ¶
type Actor ¶
type Actor interface { // NewActor Create new actors data and add the returned ID to the accounts field. NewActor() (*Actors, error) AddActor() (*Actors, error) // FindByPreferredUsername Find the Actor collection by PreferredUsername. FindByPreferredUsername() (*[]Actors, error) FindActorByAccountUsername() (*Actors, error) FindActorByID() (*Actors, error) FindActorByUrl() (*Actors, error) Update() error }
type Actors ¶
type Actors struct { gorm.Model PreferredUsername string `gorm:"primaryKey;type:text;preferredUsername;"` Domain string `gorm:"index;type:text;domain"` Avatar string `gorm:"type:text;avatar"` Name string `gorm:"type:text;name"` Summary string `gorm:"type:text;summary"` Inbox string `gorm:"type:text;inbox"` Url string `gorm:"index;test;url"` PublicKey string `gorm:"type:text;public_key"` // ID returned after completing the registration of the matrix account. MatrixID string `gorm:"type:text;matrix_id;unique"` MatrixToken string `gorm:"type:text;matrix_token"` // Whether it is a robot or other type of account ActorType string `gorm:"type:text;actor_type"` // Set whether it is a remote actor. IsRemote bool `gorm:"type:boolean;is_remote"` }
func NewActorID ¶
func NewActorUrl ¶
func NewAddActor ¶
func NewAddActor(PreferredUsername, Domain, Avatar, Name, Summary, Inbox, Url, PublicKey, MatrixID, ActorType string) *Actors
NewAddActor Add an Actor from remote and set IsRemote to true.
func (*Actors) FindActorByAccountUsername ¶
func (*Actors) FindActorByID ¶
func (*Actors) FindActorByUrl ¶
func (*Actors) FindByPreferredUsername ¶
type Follows ¶
type Follows struct { gorm.Model ActorID uint `gorm:"primaryKey;bigint;actor_id"` TargetID uint `gorm:"primaryKey;bigint;target_id"` }
func NewFetchByID ¶
func NewFollows ¶
func (*Follows) FetchFollowers ¶
func (*Follows) FetchFollowing ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.